File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
"""Tests of multiple engines for django_coverage_plugin."""
5
5
6
+ from django_coverage_plugin import DjangoTemplatePluginException
7
+
6
8
from .plugin_test import DjangoPluginTestCase , django_start_at
7
9
8
10
@@ -36,3 +38,19 @@ def test_file_template(self):
36
38
def test_string_template (self ):
37
39
text = self .run_django_coverage (text = 'Hello' , using = 'other' )
38
40
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 ()
You can’t perform that action at this time.
0 commit comments