Changes between Initial Version and Version 1 of Ticket #30386, comment 10


Ignore:
Timestamp:
02/17/23 14:44:06 (8 months ago)
Author:
Mariusz Felisiak
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30386, comment 10

    initial v1  
    11As regards to this ticket, I worked on it following this steps
    2 
     2{{{
    33class House(models.Model):
    44    name = models.CharField(max_length=255, primary_key=True)
     
    1010    def __str__(self):
    1111        return self.house.name
    12 
     12}}}
    1313
    1414using the quote function from django.contrib.admin.utils should fix this
    1515
     16{{{
    1617 def test_foreign_key_raw_id_widget_renders_quoted_pk_in_change_url(self):
    1718        house = House.objects.create(name='?a=b')
     
    2728        # check that the primary key is properly quoted in the rendered HTML
    2829        self.assertIn(f'href="/admin_widgets/house/{pk_quoted}/change/"', rendered)
    29 
    30 
    31 
     30}}}
Back to Top