summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_views/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/admin_views/tests.py')
-rw-r--r--tests/regressiontests/admin_views/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 62f69f6d94..d52ccafbd6 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -770,7 +770,10 @@ class CustomModelAdminTest(AdminViewBasicTest):
self.assertContains(response, 'Hello from a custom logout template')
def testCustomAdminSiteIndexViewAndTemplate(self):
- response = self.client.get('/test_admin/admin2/')
+ try:
+ response = self.client.get('/test_admin/admin2/')
+ except TypeError:
+ self.fail('AdminSite.index_template should accept a list of template paths')
self.assertIsInstance(response, TemplateResponse)
self.assertTemplateUsed(response, 'custom_admin/index.html')
self.assertContains(response, 'Hello from a custom index template *bar*')
@@ -792,6 +795,15 @@ class CustomModelAdminTest(AdminViewBasicTest):
response = self.client.get('/test_admin/%s/my_view/' % self.urlbit)
self.assertEqual(response.content, b"Django is a magical pony!")
+ def test_pwd_change_custom_template(self):
+ self.client.login(username='super', password='secret')
+ su = User.objects.get(username='super')
+ try:
+ response = self.client.get('/test_admin/admin4/auth/user/%s/password/' % su.pk)
+ except TypeError:
+ self.fail('ModelAdmin.change_user_password_template should accept a list of template paths')
+ self.assertEqual(response.status_code, 200)
+
def get_perm(Model, perm):
"""Return the permission object, for the Model"""