summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-02-24 01:00:57 +0000
committerRamiro Morales <cramm0@gmail.com>2011-02-24 01:00:57 +0000
commit4b13e76debbb64818559b504a2dd043af5fcad33 (patch)
treebddae2ce418c97ee869872fad728b097bbda3ef6 /tests
parent12bd7bcb35703c2d2d19f6b79140d727ddee6e5f (diff)
Fixed #14012 (again) -- Admin app: Don't show the full user edition view after adding a user in a FK popup. Thanks dburke for reporting this regression introduced in r14628.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_views/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index bbef907aac..aa8bf07380 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -2637,13 +2637,25 @@ class UserAdminTest(TestCase):
[u"The two password fields didn't match."])
def test_user_fk_popup(self):
+ """Quick user addition in a FK popup shouldn't invoke view for further user customization"""
response = self.client.get('/test_admin/admin/admin_views/album/add/')
self.assertEqual(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.assertEqual(response.status_code, 200)
self.assertNotContains(response, 'name="_continue"')
self.assertNotContains(response, 'name="_addanother"')
+ data = {
+ 'username': 'newuser',
+ 'password1': 'newpassword',
+ 'password2': 'newpassword',
+ '_popup': '1',
+ '_save': '1',
+ }
+ response = self.client.post('/test_admin/admin/auth/user/add/?_popup=1', data, follow=True)
+ self.assertEqual(response.status_code, 200)
+ self.assertContains(response, 'dismissAddAnotherPopup')
def test_save_add_another_button(self):
user_count = User.objects.count()