'Link to the changeform of the object in changelist should use reverse() and be quoted -- #18072'

def test_changelist_to_changeform_link(self):

    response = self.client.get(reverse('admin:admin_views_modelwithstringprimarykey_changelist'))
    pk_final_url = escape(iri_to_uri(quote(self.pk)))
    change_url = reverse('admin:admin_views_modelwithstringprimarykey_change', args=('__fk__',)).replace('__fk__', pk_final_url)
    should_contain = ('<th    class="field-__str__"><a    href="%s">%s</a></th>' % (change_url, escape(self.pk)))
    self.assertContains(response, should_contain)
