fixing TEMPLATES on the test settings

This commit is contained in:
Alex Barcelo 2016-10-20 08:26:06 +02:00
parent 40c046e993
commit 8e626af41f

View File

@ -38,6 +38,27 @@ class QuickDjangoTest(object):
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': (
# Defaults:
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
# Our extra:
"django.template.context_processors.request",
),
},
},
]
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.apps = args self.apps = args
# Get the version of the test suite # Get the version of the test suite
@ -91,7 +112,8 @@ class QuickDjangoTest(object):
INSTALLED_APPS = self.INSTALLED_APPS + self.apps, INSTALLED_APPS = self.INSTALLED_APPS + self.apps,
MIDDLEWARE_CLASSES = self.MIDDLEWARE_CLASSES, MIDDLEWARE_CLASSES = self.MIDDLEWARE_CLASSES,
ROOT_URLCONF = self.apps[0] + '.urls', ROOT_URLCONF = self.apps[0] + '.urls',
STATIC_URL = '/static/' STATIC_URL = '/static/',
TEMPLATES = self.TEMPLATES,
) )
# compatibility with django 1.8 downwards # compatibility with django 1.8 downwards