1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.2.X] 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.

Backport of r13051 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-08-06 14:59:13 +00:00
parent 8419b092ae
commit 7930d8c477
3 changed files with 20 additions and 4 deletions

View File

@@ -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"')