summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-12-28 14:15:34 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-12-28 14:15:34 +0000
commit58bf653a26aae6ec466761c5d5933d1a5edfa641 (patch)
treeff908a838e36064e0836f6c9127befcca8114321 /tests/regressiontests
parentf1fe7c00e2c5496fd6998965385834f720bb35c2 (diff)
[1.1.X] 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 Backport of r12011 from trunk git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/admin_views/tests.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index bdc0c0376d..9535381049 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -65,11 +65,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.