From 3952d3129cbed5bdbf207c5c76e8b97e7e229279 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 28 Dec 2009 14:08:11 +0000 Subject: Fixed #11191 - Admin throws 500 instead of 404 for PK of incorrect type Thanks to mmachine for report and test, and Chris Beaven for the patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@12011 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_views/tests.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 320b632537..df43701586 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -63,11 +63,20 @@ class AdminViewBasicTest(TestCase): def testBasicEditGet(self): """ - A smoke test to ensureGET on the change_view works. + A smoke test to ensure GET on the change_view works. """ response = self.client.get('/test_admin/%s/admin_views/section/1/' % self.urlbit) self.failUnlessEqual(response.status_code, 200) + def testBasicEditGetStringPK(self): + """ + A smoke test to ensure GET on the change_view works (returns an HTTP + 404 error, see #11191) when passing a string as the PK argument for a + model with an integer PK field. + """ + response = self.client.get('/test_admin/%s/admin_views/section/abc/' % self.urlbit) + self.failUnlessEqual(response.status_code, 404) + def testBasicAddPost(self): """ A smoke test to ensure POST on add_view works. -- cgit v1.3