Ticket #14417: unicode_model_name_test.diff

File unicode_model_name_test.diff, 1.0 KB (added by Claude Paroz, 14 years ago)

Add test for unicode model name

  • tests/regressiontests/admin_views/tests.py

    diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
    index 4c96306..519a8b2 100644
    a b class AdminViewUnicodeTest(TestCase):  
    10851085        response = self.client.post('/test_admin/admin/admin_views/book/1/delete/', delete_dict)
    10861086        self.assertRedirects(response, '/test_admin/admin/admin_views/book/')
    10871087
     1088    def testUnicodeRecentList(self):
     1089        """
     1090        Test that unicode model name is properly displayed in Recent Actions list
     1091        """
     1092        from models import Chapter
     1093        chapter_ct = ContentType.objects.get_for_model(Chapter)
     1094        LogEntry.objects.log_action(100, chapter_ct.pk, 1, "Some chapter", 2)
     1095        response = self.client.get('/test_admin/admin/')
     1096        self.assertContains(response, """<span class="mini quiet">¿Chapter?</span>""")
     1097
    10881098
    10891099class AdminViewListEditable(TestCase):
    10901100    fixtures = ['admin-views-users.xml', 'admin-views-person.xml']
Back to Top