Changes between Initial Version and Version 1 of Ticket #30386, comment 10
- Timestamp:
- Feb 17, 2023, 8:44:06 AM (21 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30386, comment 10
initial v1 1 1 As regards to this ticket, I worked on it following this steps 2 2 {{{ 3 3 class House(models.Model): 4 4 name = models.CharField(max_length=255, primary_key=True) … … 10 10 def __str__(self): 11 11 return self.house.name 12 12 }}} 13 13 14 14 using the quote function from django.contrib.admin.utils should fix this 15 15 16 {{{ 16 17 def test_foreign_key_raw_id_widget_renders_quoted_pk_in_change_url(self): 17 18 house = House.objects.create(name='?a=b') … … 27 28 # check that the primary key is properly quoted in the rendered HTML 28 29 self.assertIn(f'href="/admin_widgets/house/{pk_quoted}/change/"', rendered) 29 30 31 30 }}}