mirror of
https://github.com/django/django.git
synced 2025-11-01 04:17:59 +00:00
Fixed #22920 -- Avoid masking some exceptions.
If loading an application trigger an ImportError, the details of that error were lost in some cases. Thanks Ben Davis for the report.
This commit is contained in:
parent
d3543af750
commit
b161c01c48
3 changed files with 21 additions and 7 deletions
|
|
@ -166,6 +166,14 @@ class AppsTests(TestCase):
|
|||
with self.settings(INSTALLED_APPS=['apps.apps.RelabeledAppsConfig', 'apps']):
|
||||
pass
|
||||
|
||||
def test_import_exception_is_not_masked(self):
|
||||
"""
|
||||
App discovery should preserve stack traces. Regression test for #22920.
|
||||
"""
|
||||
with six.assertRaisesRegex(self, ImportError, "Oops"):
|
||||
with self.settings(INSTALLED_APPS=['apps.failing_app']):
|
||||
pass
|
||||
|
||||
def test_models_py(self):
|
||||
"""
|
||||
Tests that the models in the models.py file were loaded correctly.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue