Skip to content

Commit f7b3f55

Browse files
committed
Add a test that all engines must be debug.
1 parent 6c3fce9 commit f7b3f55

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_engines.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
"""Tests of multiple engines for django_coverage_plugin."""
55

6+
from django_coverage_plugin import DjangoTemplatePluginException
7+
68
from .plugin_test import DjangoPluginTestCase, django_start_at
79

810

@@ -36,3 +38,19 @@ def test_file_template(self):
3638
def test_string_template(self):
3739
text = self.run_django_coverage(text='Hello', using='other')
3840
self.assertEqual(text, 'Hello')
41+
42+
def test_third_engine_not_debug(self):
43+
from django.test import modify_settings
44+
engine3 = {
45+
'NAME': 'notdebug',
46+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
47+
'DIRS': ['templates3'], # where the tests put things.
48+
}
49+
modified_settings = modify_settings(TEMPLATES={'append': [engine3]})
50+
modified_settings.enable()
51+
self.addCleanup(modified_settings.disable)
52+
53+
self.make_template('Hello')
54+
msg = "Template debugging must be enabled in settings."
55+
with self.assertRaisesRegexp(DjangoTemplatePluginException, msg):
56+
self.run_django_coverage()

0 commit comments

Comments
 (0)