diff options
Diffstat (limited to 'tests/admin_views')
| -rw-r--r-- | tests/admin_views/customadmin.py | 3 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/admin_views/customadmin.py b/tests/admin_views/customadmin.py index 906fb871db..3276a3091d 100644 --- a/tests/admin_views/customadmin.py +++ b/tests/admin_views/customadmin.py @@ -33,6 +33,9 @@ class Admin2(admin.AdminSite): def my_view(self, request): return HttpResponse("Django is a magical pony!") + def password_change(self, request, extra_context=None): + return super(Admin2, self).password_change(request, {'spam': 'eggs'}) + class UserLimitedAdmin(UserAdmin): # used for testing password change on a user not in queryset diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index f55bcacd78..6313fdfd08 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1012,6 +1012,12 @@ class CustomModelAdminTest(AdminViewBasicTestCase): self.assertTemplateUsed(response, 'custom_admin/password_change_form.html') self.assertContains(response, 'Hello from a custom password change form template') + def test_custom_admin_site_password_change_with_extra_context(self): + response = self.client.get('/test_admin/admin2/password_change/') + self.assertIsInstance(response, TemplateResponse) + self.assertTemplateUsed(response, 'custom_admin/password_change_form.html') + self.assertContains(response, 'eggs') + def test_custom_admin_site_password_change_done_template(self): response = self.client.get('/test_admin/admin2/password_change/done/') self.assertIsInstance(response, TemplateResponse) |
