Skip to content

Commit

Permalink
Add TEMPLATES to psycopg2 settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekwg committed Jul 6, 2016
1 parent 4b05de9 commit aeaab80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import os
import sys

import django

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG

SECRET_KEY = '!5myuh^d23p9$$lo5k$39x&ji!vceayg+wwt472!bgs$0!i3k4'

Expand Down
22 changes: 19 additions & 3 deletions tests/settings_psycopg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import os
import sys

import django

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG

SECRET_KEY = '!5myuh^d23p9$$lo5k$39x&ji!vceayg+wwt472!bgs$0!i3k4'

Expand Down Expand Up @@ -67,17 +67,33 @@
USE_TZ = True
STATIC_URL = '/static/'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

# local settings must be imported before test runner otherwise they'll be ignored
try:
from local_settings_psycopg import *
from local_settings_psycopg import * # noqa
except ImportError:
pass

if django.VERSION[:2] >= (1, 6):
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
else:
try:
import discover_runner
import discover_runner # noqa
TEST_RUNNER = "discover_runner.DiscoverRunner"
except ImportError:
print("For run tests with django <= 1.5 you should install "
Expand Down

0 comments on commit aeaab80

Please sign in to comment.