1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #32915 - Don't catch ImportErrors unless it's the settings module that can't be imported

Based on work by Rohith PR and others in PR #14622
This commit is contained in:
Ben Cail
2022-11-01 14:55:40 -04:00
parent f05edb2b43
commit f992997fbe
4 changed files with 26 additions and 4 deletions

View File

@@ -1412,12 +1412,12 @@ class ManageSettingsWithSettingsErrors(AdminScriptTestCase):
self.write_settings(
"settings.py",
extra="from django.core.exceptions import ImproperlyConfigured\n"
"raise ImproperlyConfigured()",
"raise ImproperlyConfigured('Improper configuration')",
)
args = ["help"]
out, err = self.run_manage(args)
self.assertOutput(out, "only Django core commands are listed")
self.assertNoOutput(err)
self.assertOutput(err, "Improper configuration")
class ManageCheck(AdminScriptTestCase):