diff options
| author | orlnub123 <orlnub123@gmail.com> | 2019-01-11 11:11:36 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-01-12 11:07:03 -0500 |
| commit | 573f44d62fe1e87e2c20a74eba5e20ca9ff0ed85 (patch) | |
| tree | 41dddc27a3684e97cbabc0899bc4eb12c2608321 | |
| parent | abf8e390a4161a051ed1c4be11b9447866b06ba8 (diff) | |
Fixed #30057 -- Fixed diffsettings ignoring custom configured settings.
Regression in 49b679371fe9beddcd23a93b5fdbadea914f37f8.
| -rw-r--r-- | django/core/management/commands/diffsettings.py | 4 | ||||
| -rw-r--r-- | tests/admin_scripts/configured_settings_manage.py | 2 | ||||
| -rw-r--r-- | tests/admin_scripts/tests.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/django/core/management/commands/diffsettings.py b/django/core/management/commands/diffsettings.py index d82d4a9da8..54ec93cb16 100644 --- a/django/core/management/commands/diffsettings.py +++ b/django/core/management/commands/diffsettings.py @@ -1,9 +1,9 @@ from django.core.management.base import BaseCommand -def module_to_dict(module, omittable=lambda k: k.startswith('_')): +def module_to_dict(module, omittable=lambda k: k.startswith('_') or not k.isupper()): """Convert a module namespace to a Python dictionary.""" - return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)} + return {k: repr(getattr(module, k)) for k in dir(module) if not omittable(k)} class Command(BaseCommand): diff --git a/tests/admin_scripts/configured_settings_manage.py b/tests/admin_scripts/configured_settings_manage.py index 7c2088ecfa..e057e70810 100644 --- a/tests/admin_scripts/configured_settings_manage.py +++ b/tests/admin_scripts/configured_settings_manage.py @@ -5,5 +5,5 @@ from django.conf import settings from django.core.management import execute_from_command_line if __name__ == '__main__': - settings.configure(DEBUG=True) + settings.configure(DEBUG=True, CUSTOM=1) execute_from_command_line(sys.argv) diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 410652efbc..15a18eefee 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -2236,7 +2236,7 @@ class DiffSettings(AdminScriptTestCase): def test_settings_configured(self): out, err = self.run_manage(['diffsettings'], configured_settings=True) self.assertNoOutput(err) - self.assertOutput(out, 'DEBUG = True') + self.assertOutput(out, 'CUSTOM = 1 ###\nDEBUG = True') def test_all(self): """The all option also shows settings with the default value.""" |
