diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2008-11-09 18:51:28 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2008-11-09 18:51:28 +0000 |
| commit | c367e2869eaa28598aab7aa7ea2e76b596fe09b2 (patch) | |
| tree | 43ba6cd621d57c47b9fca1efaf71abfc46cd2917 /tests | |
| parent | b81bc22ad241d2ff72344885a44eb61f0cf9a99c (diff) | |
Fixed #9514 -- Made admin change_form template correctly recognize/report when a form has only a single error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 26d807e731..4a568279e7 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -387,6 +387,18 @@ class AdminViewPermissionsTest(TestCase): post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict) self.assertRedirects(post, '/test_admin/admin/admin_views/article/') self.failUnlessEqual(Article.objects.get(pk=1).content, '<p>edited article</p>') + + # one error in form should produce singular error message, multiple errors plural + change_dict['title'] = '' + post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict) + self.failUnlessEqual(request.status_code, 200) + self.failUnless('Please correct the error below.' in post.content, + 'Singular error message not found in response to post with one error.') + change_dict['content'] = '' + post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict) + self.failUnlessEqual(request.status_code, 200) + self.failUnless('Please correct the errors below.' in post.content, + 'Plural error message not found in response to post with multiple errors.') self.client.get('/test_admin/admin/logout/') def testCustomModelAdminTemplates(self): |
