          prefix = '/test_admin/admin/admin_views/modelwithstringprimarykey/'
          response = self.client.get(prefix)
          # this URL now comes through reverse(), thus url quoting and iri_to_uri encoding
          pk_final_url = escape(iri_to_uri(urlquote(quote(self.pk))))
          should_contain = """<th><a href="%s%s/">%s</a></th>""" % (prefix, pk_final_url, escape(self.pk))
          self.assertContains(response, should_contain)
  
      def test_recentactions_link(self):
          "The link from the recent actions list referring to the changeform of the object should be quoted"
          response = self.client.get('/test_admin/admin/')
 
</s> remove                     row_class = mark_safe(' class="nowrap"')
 </s> add                     row_classes.append('nowrap') </s> remove         self.assertContains(response, '<th><a href="%s">%d</a></th>' % (link1, story1.id), 1)
        self.assertContains(response, '<th><a href="%s">%d</a></th>' % (link2, story2.id), 1)
 </s> add         self.assertContains(response, '<th class="field-id"><a href="%s">%d</a></th>' % (link1, story1.id), 1)
        self.assertContains(response, '<th class="field-id"><a href="%s">%d</a></th>' % (link2, story2.id), 1)
        should_contain = """<th class="field-__str__"><a href="%s%s/">%s</a></th>""" % (prefix, pk_final_url, escape(self.pk))
          prefix = '/test_admin/admin/admin_views/modelwithstringprimarykey/'
          response = self.client.get(prefix)
          # this URL now comes through reverse(), thus url quoting and iri_to_uri encoding
          pk_final_url = escape(iri_to_uri(urlquote(quote(self.pk))))
        should_contain = """<th class="field-__str__"><a href="%s%s/">%s</a></th>""" % (prefix, pk_final_url, escape(self.pk))
          self.assertContains(response, should_contain)
  
      def test_recentactions_link(self):
          "The link from the recent actions list referring to the changeform of the object should be quoted"
          response = self.client.get('/test_admin/admin/')
keep keep keep keep replace keep keep keep keep keep
 Fixed #11195 -- Added CSS classes to the changelist cells to allow style customizations. Thanks to akaihola, Ramiro Morales and vdboor for their work on the patch. 
tests/admin_views/tests.py