summaryrefslogtreecommitdiff
path: root/tests/apps/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-08-31 18:51:55 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-09-08 23:16:50 +0200
commitb161c01c48b4c353d7d1a47e9097391a8eb2e047 (patch)
tree61925e5b35f722cf6b1ed85378dce38e601c6fe0 /tests/apps/tests.py
parentd3543af7509d01f396997f13ab3c3b391839a511 (diff)
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.
Diffstat (limited to 'tests/apps/tests.py')
-rw-r--r--tests/apps/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/apps/tests.py b/tests/apps/tests.py
index 2c7629ac97..513ed32039 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -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.