mirror of
https://github.com/django/django.git
synced 2025-08-02 10:02:41 +00:00
Fixed #17037 -- Added a --all option to diffsettings.
This commit is contained in:
parent
68905695b8
commit
20a91cce04
4 changed files with 31 additions and 6 deletions
|
@ -1661,11 +1661,21 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
|
|||
|
||||
class DiffSettings(AdminScriptTestCase):
|
||||
"""Tests for diffsettings management command."""
|
||||
|
||||
def test_basic(self):
|
||||
"Runs without error and emits settings diff."
|
||||
"""Runs without error and emits settings diff."""
|
||||
self.write_settings('settings_to_diff.py', sdict={'FOO': '"bar"'})
|
||||
self.addCleanup(self.remove_settings, 'settings_to_diff.py')
|
||||
args = ['diffsettings', '--settings=settings_to_diff']
|
||||
out, err = self.run_manage(args)
|
||||
self.assertNoOutput(err)
|
||||
self.assertOutput(out, "FOO = 'bar' ###")
|
||||
|
||||
def test_all(self):
|
||||
"""The all option also shows settings with the default value."""
|
||||
self.write_settings('settings_to_diff.py', sdict={'STATIC_URL': 'None'})
|
||||
self.addCleanup(self.remove_settings, 'settings_to_diff.py')
|
||||
args = ['diffsettings', '--settings=settings_to_diff', '--all']
|
||||
out, err = self.run_manage(args)
|
||||
self.assertNoOutput(err)
|
||||
self.assertOutput(out, "### STATIC_URL = None")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue