From 2cd4cf58d32c5d4b163a466f608dff31bac66b87 Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Sun, 1 Jul 2012 18:40:50 -0700 Subject: Fixed #18550 -- Ensured that the admin history view works with escaped primary keys. Thanks to josh.oosterman for the report and patch. --- tests/regressiontests/admin_views/tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index f074d77b11..937b086d40 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -1344,15 +1344,20 @@ class AdminViewStringPrimaryKeyTest(TestCase): def setUp(self): self.client.login(username='super', password='secret') content_type_pk = ContentType.objects.get_for_model(ModelWithStringPrimaryKey).pk - LogEntry.objects.log_action(100, content_type_pk, self.pk, self.pk, 2, change_message='') + LogEntry.objects.log_action(100, content_type_pk, self.pk, self.pk, 2, change_message='Changed something') def tearDown(self): self.client.logout() def test_get_history_view(self): - "Retrieving the history for the object using urlencoded form of primary key should work" + """ + Retrieving the history for an object using urlencoded form of primary + key should work. + Refs #12349, #18550. + """ response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/history/' % quote(self.pk)) self.assertContains(response, escape(self.pk)) + self.assertContains(response, 'Changed something') self.assertEqual(response.status_code, 200) def test_get_change_view(self): -- cgit v1.3