summaryrefslogtreecommitdiff
path: root/tests/template_backends
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2020-12-27 10:23:16 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-12-28 07:31:37 +0100
commit89fc144dedc737a79929231438f035b1d4a993c9 (patch)
tree1b83c8577f2183f91f5154f60358da94c7682800 /tests/template_backends
parent429d089d0a8fbd400e0c010708df4f0d16218970 (diff)
downloaddjango-89fc144dedc737a79929231438f035b1d4a993c9.tar.gz
Fixed #27827 -- Used "raise from" when raising InvalidTemplateLibrary exceptions in get_package_libraries().
This change sets the __cause__ attribute to raised exceptions and makes small cleanups in error messages.
Diffstat (limited to 'tests/template_backends')
-rw-r--r--tests/template_backends/test_django.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/template_backends/test_django.py b/tests/template_backends/test_django.py
index 6f5035c741..047af67df5 100644
--- a/tests/template_backends/test_django.py
+++ b/tests/template_backends/test_django.py
@@ -104,13 +104,14 @@ class DjangoTemplatesTests(TemplateStringsTests):
InvalidTemplateLibrary,
"ImportError raised when trying to load "
"'template_backends.apps.importerror.templatetags.broken_tags'"
- ):
+ ) as cm:
DjangoTemplates({
'DIRS': [],
'APP_DIRS': False,
'NAME': 'django',
'OPTIONS': {},
})
+ self.assertIsInstance(cm.exception.__cause__, ImportError)
def test_builtins_discovery(self):
engine = DjangoTemplates({