summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-14 13:43:13 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-14 13:43:13 +0000
commit13953badb7dd784c07ec4617e6a28e5143462ed2 (patch)
tree44ffada1dd128d1d340495db87105b32530997b0 /tests
parente4a8b6c3f9991f1c503d201f15d5f9ae6849ed25 (diff)
[1.2.X] Fixed #13796 -- Ensure that builtin tags and filters are included in admin documentation views.
Backport of r13588 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13589 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_views/tests.py37
-rwxr-xr-xtests/runtests.py1
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 41aade0561..bb787be638 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -2170,3 +2170,40 @@ class UserAdminTest(TestCase):
self.assertRedirects(response, '/test_admin/admin/auth/user/add/')
self.assertEquals(User.objects.count(), user_count + 1)
self.assertNotEquals(new_user.password, UNUSABLE_PASSWORD)
+
+class AdminDocsTest(TestCase):
+ fixtures = ['admin-views-users.xml']
+
+ def setUp(self):
+ self.client.login(username='super', password='secret')
+
+ def tearDown(self):
+ self.client.logout()
+
+ def test_tags(self):
+ response = self.client.get('/test_admin/admin/doc/tags/')
+
+ # The builtin tag group exists
+ self.assertContains(response, "<h2>Built-in tags</h2>", count=2)
+
+ # A builtin tag exists in both the index and detail
+ self.assertContains(response, '<h3 id="autoescape">autoescape</h3>')
+ self.assertContains(response, '<li><a href="#autoescape">autoescape</a></li>')
+
+ # An app tag exists in both the index and detail
+ # The builtin tag group exists
+ self.assertContains(response, "<h2>admin_list</h2>", count=2)
+
+ # A builtin tag exists in both the index and detail
+ self.assertContains(response, '<h3 id="autoescape">autoescape</h3>')
+ self.assertContains(response, '<li><a href="#admin_actions">admin_actions</a></li>')
+
+ def test_filters(self):
+ response = self.client.get('/test_admin/admin/doc/filters/')
+
+ # The builtin filter group exists
+ self.assertContains(response, "<h2>Built-in filters</h2>", count=2)
+
+ # A builtin filter exists in both the index and detail
+ self.assertContains(response, '<h3 id="add">add</h3>')
+ self.assertContains(response, '<li><a href="#add">add</a></li>')
diff --git a/tests/runtests.py b/tests/runtests.py
index 5585f75d5a..cd60cabc93 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -27,6 +27,7 @@ ALWAYS_INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.comments',
'django.contrib.admin',
+ 'django.contrib.admindocs',
]
def get_test_models():