summaryrefslogtreecommitdiff
path: root/tests/admin_docs/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_docs/tests.py')
-rw-r--r--tests/admin_docs/tests.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index 60e35569d9..0881de20ee 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -1,3 +1,4 @@
+import datetime
import sys
import unittest
@@ -12,6 +13,19 @@ from django.test import TestCase, modify_settings, override_settings
from .models import Company, Person
+class TestDataMixin(object):
+
+ @classmethod
+ def setUpTestData(cls):
+ # password = "secret"
+ User.objects.create(
+ pk=100, username='super', first_name='Super', last_name='User', email='super@example.com',
+ password='sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158', is_active=True, is_superuser=True,
+ is_staff=True, last_login=datetime.datetime(2007, 5, 30, 13, 20, 10),
+ date_joined=datetime.datetime(2007, 5, 30, 13, 20, 10)
+ )
+
+
@override_settings(
PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_docs.urls')
@@ -39,8 +53,7 @@ class MiscTests(AdminDocsTestCase):
@unittest.skipUnless(utils.docutils_is_available, "no docutils installed.")
-class AdminDocViewTests(AdminDocsTestCase):
- fixtures = ['data.xml']
+class AdminDocViewTests(TestDataMixin, AdminDocsTestCase):
def setUp(self):
self.client.login(username='super', password='secret')
@@ -124,8 +137,7 @@ class AdminDocViewTests(AdminDocsTestCase):
utils.docutils_is_available = True
-class XViewMiddlewareTest(AdminDocsTestCase):
- fixtures = ['data.xml']
+class XViewMiddlewareTest(TestDataMixin, AdminDocsTestCase):
def test_xview_func(self):
user = User.objects.get(username='super')
@@ -201,13 +213,11 @@ class DefaultRoleTest(AdminDocsTestCase):
@unittest.skipUnless(utils.docutils_is_available, "no docutils installed.")
-class TestModelDetailView(AdminDocsTestCase):
+class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
"""
Tests that various details render correctly
"""
- fixtures = ['data.xml']
-
def setUp(self):
self.client.login(username='super', password='secret')
self.response = self.client.get(