mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +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:
parent
429d089d0a
commit
89fc144ded
2 changed files with 3 additions and 2 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue