summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-12-17 22:51:42 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 17:02:30 +0100
commitd3205e3e2eb0202e7bdffaee3e2a80ad444b1ca2 (patch)
tree11cc72ef84a3c35a5736de34b01bd52106fce08f /tests/admin_views
parentcf0fd65ed42d5d4f0585da413db4b1cf7c6b0d1a (diff)
Deprecated TEMPLATE_DIRS.
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 73564d4f94..e8e2abb2ef 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -6,7 +6,7 @@ import re
import datetime
import unittest
-from django.conf import settings, global_settings
+from django.conf import global_settings
from django.core import mail
from django.core.checks import Error
from django.core.files import temp as tempfile
@@ -62,7 +62,6 @@ from .admin import site, site2, CityAdmin
ERROR_MESSAGE = "Please enter the correct username and password \
for a staff account. Note that both fields may be case-sensitive."
-ADMIN_VIEW_TEMPLATES_DIR = settings.TEMPLATE_DIRS + (os.path.join(os.path.dirname(upath(__file__)), 'templates'),)
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
@@ -788,7 +787,24 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
self.assertContains(response, '<a href="/my-site-url/">View site</a>')
-@override_settings(TEMPLATE_DIRS=ADMIN_VIEW_TEMPLATES_DIR)
+@override_settings(TEMPLATES=[{
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ # Put this app's templates dir in DIRS to take precedence over the admin's
+ # templates dir.
+ 'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.i18n',
+ 'django.template.context_processors.tz',
+ 'django.template.context_processors.media',
+ 'django.template.context_processors.static',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+}])
class AdminCustomTemplateTests(AdminViewBasicTestCase):
def test_extended_bodyclass_template_change_form(self):
"""