Permalink
Browse files

Added a test for AdminSite.app_index_template; refs #8498.

  • Loading branch information...
1 parent 0674b38 commit ccf8f1e18f138dae369a2004c83db9704ad52d99 @ArcTanSusan ArcTanSusan committed with timgraham Jul 31, 2013
Showing with 13 additions and 0 deletions.
  1. +1 −0 tests/admin_views/customadmin.py
  2. +6 −0 tests/admin_views/tests.py
  3. +6 −0 tests/templates/custom_admin/app_index.html
@@ -13,6 +13,7 @@
class Admin2(admin.AdminSite):
+ app_index_template = 'custom_admin/app_index.html'
login_form = forms.CustomAdminAuthenticationForm
login_template = 'custom_admin/login.html'
logout_template = 'custom_admin/logout.html'
@@ -806,6 +806,12 @@ def testCustomAdminSiteIndexViewAndTemplate(self):
self.assertTemplateUsed(response, 'custom_admin/index.html')
self.assertContains(response, 'Hello from a custom index template *bar*')
+ def testCustomAdminSiteAppIndexViewandTemplate(self):
+ response = self.client.get('/test_admin/admin2/admin_views/')
+ self.assertIsInstance(response, TemplateResponse)
+ self.assertTemplateUsed(response, 'custom_admin/app_index.html')
+ self.assertContains(response, 'Hello from a custom app_index template')
+
def testCustomAdminSitePasswordChangeTemplate(self):
response = self.client.get('/test_admin/admin2/password_change/')
self.assertIsInstance(response, TemplateResponse)
@@ -0,0 +1,6 @@
+{% extends "admin/app_index.html" %}
+
+{% block content %}
+Hello from a custom app_index template
+{{ block.super }}
+{% endblock %}

0 comments on commit ccf8f1e

Please sign in to comment.