From 7b9399019bbefa3edfcbd2d1c47dabb537dc4bf0 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 20 Jul 2016 10:53:48 +0100 Subject: [PATCH] Give Jinja2 templates their own location in testapp The Jinja2 template config here isn't currently used at all - having the same APP_DIRS / DIRS config as the Django template engine (which has higher precedence) means that it will never be selected for rendering templates, and the existing jinja2 tests bypass Django's template engine selection and call the jinja2 engine directly. By giving jinja2 templates their own dedicated location, we can reliably control which engine is used for which templates. --- wagtail/tests/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wagtail/tests/settings.py b/wagtail/tests/settings.py index 67bb2239f1..2defe9cc15 100644 --- a/wagtail/tests/settings.py +++ b/wagtail/tests/settings.py @@ -55,7 +55,10 @@ TEMPLATES = [ }, { 'BACKEND': 'django.template.backends.jinja2.Jinja2', - 'APP_DIRS': True, + 'APP_DIRS': False, + 'DIRS': [ + os.path.join(WAGTAIL_ROOT, 'tests', 'testapp', 'jinja2_templates'), + ], 'OPTIONS': { 'extensions': [ 'wagtail.wagtailcore.jinja2tags.core',