summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_views/tests.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-06 14:58:05 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-06 14:58:05 +0000
commit2ab3b52d2adb0aa6d15aa94e4fc5aab9ec3554d0 (patch)
treeb081200181bf2c1a98759a5e2fafbdf926114f3c /tests/regressiontests/admin_views/tests.py
parentf90a25551dbd10b7d57725a2abec3e11cf0e22cd (diff)
Fixed #14012 -- Corrected the handling of the create user popup dialog in the admin. Thanks to gk@lka.hu for the report, and Ramiro Morales for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_views/tests.py')
-rw-r--r--tests/regressiontests/admin_views/tests.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 1385e5e0aa..badbfa4cab 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -2113,11 +2113,9 @@ class ReadonlyTest(TestCase):
response = self.client.get('/test_admin/admin/admin_views/pizza/add/')
self.assertEqual(response.status_code, 200)
-class IncompleteFormTest(TestCase):
+class UserAdminTest(TestCase):
"""
- Tests validation of a ModelForm that doesn't explicitly have all data
- corresponding to model fields. Model validation shouldn't fail
- such a forms.
+ Tests user CRUD functionality.
"""
fixtures = ['admin-views-users.xml']
@@ -2149,3 +2147,11 @@ class IncompleteFormTest(TestCase):
self.assert_('password' not in adminform.form.errors)
self.assertEquals(adminform.form.errors['password2'],
[u"The two password fields didn't match."])
+
+ def test_user_fk_popup(self):
+ response = self.client.get('/test_admin/admin/admin_views/album/add/')
+ self.failUnlessEqual(response.status_code, 200)
+ self.assertContains(response, '/test_admin/admin/auth/user/add')
+ self.assertContains(response, 'class="add-another" id="add_id_owner" onclick="return showAddAnotherPopup(this);"')
+ response = self.client.get('/test_admin/admin/auth/user/add/?_popup=1')
+ self.assertNotContains(response, 'name="_continue"')