diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-01-12 23:34:46 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-01-12 23:34:46 +0000 |
| commit | a2056919799e48f053fa16b65569fc1e8f57ebe1 (patch) | |
| tree | f31347588a67ce910973d221396c2100b4e155b2 /tests/regressiontests/admin_views | |
| parent | 31f3a8c1ad3b6ec33c503241484107bf35cdadba (diff) | |
Fixed #8933 - Allow more admin templates to be overridden.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12217 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_views')
| -rw-r--r-- | tests/regressiontests/admin_views/customadmin.py | 3 | ||||
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/customadmin.py b/tests/regressiontests/admin_views/customadmin.py index 80570ea51d..34e39ef0ca 100644 --- a/tests/regressiontests/admin_views/customadmin.py +++ b/tests/regressiontests/admin_views/customadmin.py @@ -9,7 +9,10 @@ import models class Admin2(admin.AdminSite): login_template = 'custom_admin/login.html' + logout_template = 'custom_admin/logout.html' index_template = 'custom_admin/index.html' + password_change_template = 'custom_admin/password_change_form.html' + password_change_done_template = 'custom_admin/password_change_done.html' # A custom index view. def index(self, request, extra_context=None): diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 4d6e1d5139..7a20aaacd5 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -286,11 +286,26 @@ class CustomModelAdminTest(AdminViewBasicTest): self.assertTemplateUsed(request, 'custom_admin/login.html') self.assert_('Hello from a custom login template' in request.content) + def testCustomAdminSiteLogoutTemplate(self): + request = self.client.get('/test_admin/admin2/logout/') + self.assertTemplateUsed(request, 'custom_admin/logout.html') + self.assert_('Hello from a custom logout template' in request.content) + def testCustomAdminSiteIndexViewAndTemplate(self): request = self.client.get('/test_admin/admin2/') self.assertTemplateUsed(request, 'custom_admin/index.html') self.assert_('Hello from a custom index template *bar*' in request.content) + def testCustomAdminSitePasswordChangeTemplate(self): + request = self.client.get('/test_admin/admin2/password_change/') + self.assertTemplateUsed(request, 'custom_admin/password_change_form.html') + self.assert_('Hello from a custom password change form template' in request.content) + + def testCustomAdminSitePasswordChangeDoneTemplate(self): + request = self.client.get('/test_admin/admin2/password_change/done/') + self.assertTemplateUsed(request, 'custom_admin/password_change_done.html') + self.assert_('Hello from a custom password change done template' in request.content) + def testCustomAdminSiteView(self): self.client.login(username='super', password='secret') response = self.client.get('/test_admin/%s/my_view/' % self.urlbit) |
