Skip to content

Commit bee7d68

Browse files
author
Pamela McA'Nulty
committed
Fix check_debug
1 parent 5f06a73 commit bee7d68

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

django_coverage_plugin/plugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ def check_debug():
5353
# Django 1.8+ handles both old and new-style settings and converts them
5454
# into template engines, so we don't need to depend on settings values
5555
# directly and can look at the resulting configured objects
56+
if not hasattr(django.template.backends, "django"):
57+
raise DjangoTemplatePluginException("Can't use non-Django templates.")
58+
59+
if not hasattr(django.template.backends.django, "DjangoTemplates"):
60+
raise DjangoTemplatePluginException("Can't use non-Django templates.")
61+
5662
for engine in django.template.engines.all():
5763
if not isinstance(engine, django.template.backends.django.DjangoTemplates):
5864
raise DjangoTemplatePluginException(
59-
"Can't use non-Django templates. Found '%s': %s" %
60-
(engine.name, engine)
65+
"Can't use non-Django templates."
6166
)
6267
if not engine.engine.debug:
6368
raise DjangoTemplatePluginException(

0 commit comments

Comments
 (0)