mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Also allowed a non-overridden setting to be deleted
Refs #20032, #18824. Thanks ztorstri at gmail.com for the report.
This commit is contained in:
parent
3e3a7372f5
commit
3417ba0309
3 changed files with 13 additions and 2 deletions
|
@ -232,10 +232,15 @@ class SettingsTests(TestCase):
|
|||
Allow deletion of a setting in an overridden settings set (#18824)
|
||||
"""
|
||||
previous_i18n = settings.USE_I18N
|
||||
previous_l10n = settings.USE_L10N
|
||||
with self.settings(USE_I18N=False):
|
||||
del settings.USE_I18N
|
||||
self.assertRaises(AttributeError, getattr, settings, 'USE_I18N')
|
||||
# Should also work for a non-overridden setting
|
||||
del settings.USE_L10N
|
||||
self.assertRaises(AttributeError, getattr, settings, 'USE_L10N')
|
||||
self.assertEqual(settings.USE_I18N, previous_i18n)
|
||||
self.assertEqual(settings.USE_L10N, previous_l10n)
|
||||
|
||||
def test_override_settings_nested(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue