mirror of
https://github.com/django-components/django-components.git
synced 2025-11-25 08:21:20 +00:00
Change test setup to make test run on Django 1.7.
This commit is contained in:
parent
f435762773
commit
17eb54e18a
1 changed files with 16 additions and 7 deletions
|
|
@ -2,11 +2,20 @@ import django
|
|||
from django.conf import settings
|
||||
|
||||
if not settings.configured:
|
||||
settings.configure(
|
||||
INSTALLED_APPS=('django_components',),
|
||||
TEMPLATES=[{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': ["tests/templates/"],
|
||||
}]
|
||||
)
|
||||
# Django 1.8 changes how you set up templates, so use different
|
||||
# settings for different Django versions
|
||||
if django.VERSION >= (1, 8):
|
||||
settings.configure(
|
||||
INSTALLED_APPS=('django_components',),
|
||||
TEMPLATES=[{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': ["tests/templates/"],
|
||||
}]
|
||||
)
|
||||
else:
|
||||
settings.configure(
|
||||
INSTALLED_APPS=('django_components',),
|
||||
TEMPLATE_DIRS=["tests/templates/"],
|
||||
)
|
||||
|
||||
django.setup()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue