          self.assertNotContains(response2, "Kilbraken")
          self.assertContains(response2, "Palin")
  
  
  @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
      ROOT_URLCONF="admin_views.urls")
  class UserAdminTest(TestCase):
 
</s> remove     list_display = ('leader', 'country', 'expected')
 </s> add     list_display = ('leader', 'country', 'expected', 'sketch')

    def sketch(self, obj):
        # A method with the same name as a reverse accessor.
        return 'list-display-sketch' </s> remove     if field.is_relation and field.many_to_one and not field.related_model:
 </s> add     if (field.is_relation and
            # Generic foreign keys OR reverse relations
            ((field.many_to_one and not field.related_model) or field.one_to_many)):
    def test_list_display_method_same_name_as_reverse_accessor(self):
        """
        Should be able to use a ModelAdmin method in list_display that has the
        same name as a reverse model field ("sketch" in this case).
        """
        actor = Actor.objects.create(name="Palin", age=27)
        Inquisition.objects.create(expected=True, leader=actor, country="England")
        response = self.client.get(reverse('admin:admin_views_inquisition_changelist'))
        self.assertContains(response, 'list-display-sketch')

          self.assertNotContains(response2, "Kilbraken")
          self.assertContains(response2, "Palin")
  
    def test_list_display_method_same_name_as_reverse_accessor(self):
        """
        Should be able to use a ModelAdmin method in list_display that has the
        same name as a reverse model field ("sketch" in this case).
        """
        actor = Actor.objects.create(name="Palin", age=27)
        Inquisition.objects.create(expected=True, leader=actor, country="England")
        response = self.client.get(reverse('admin:admin_views_inquisition_changelist'))
        self.assertContains(response, 'list-display-sketch')

  
  @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
      ROOT_URLCONF="admin_views.urls")
  class UserAdminTest(TestCase):
keep keep add keep keep keep keep
 Fixed #25299 -- Fixed crash with ModelAdmin.list_display value that clashes with a model reverse accessor. 
tests/admin_views/tests.py