From aeaab80e2fc7a350a7a22ad41f987f401c7a98a2 Mon Sep 17 00:00:00 2001 From: Jarek Glowacki Date: Wed, 6 Jul 2016 21:59:13 +1000 Subject: [PATCH] Add TEMPLATES to psycopg2 settings --- tests/settings.py | 2 +- tests/settings_psycopg.py | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/settings.py b/tests/settings.py index 23af4e2..77e0b0b 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -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' diff --git a/tests/settings_psycopg.py b/tests/settings_psycopg.py index 9d458bb..e566cb7 100644 --- a/tests/settings_psycopg.py +++ b/tests/settings_psycopg.py @@ -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' @@ -67,9 +67,25 @@ 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 @@ -77,7 +93,7 @@ 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 "