mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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.
This commit is contained in:
committed by
Mariusz Felisiak
parent
429d089d0a
commit
89fc144ded
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user