mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #32873 -- Deprecated settings.USE_L10N.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
04e023e383
commit
676bd084f2
@@ -248,19 +248,19 @@ class SettingsTests(SimpleTestCase):
|
||||
Allow deletion of a setting in an overridden settings set (#18824)
|
||||
"""
|
||||
previous_i18n = settings.USE_I18N
|
||||
previous_l10n = settings.USE_L10N
|
||||
previous_tz = settings.USE_TZ
|
||||
with self.settings(USE_I18N=False):
|
||||
del settings.USE_I18N
|
||||
with self.assertRaises(AttributeError):
|
||||
getattr(settings, 'USE_I18N')
|
||||
# Should also work for a non-overridden setting
|
||||
del settings.USE_L10N
|
||||
del settings.USE_TZ
|
||||
with self.assertRaises(AttributeError):
|
||||
getattr(settings, 'USE_L10N')
|
||||
getattr(settings, 'USE_TZ')
|
||||
self.assertNotIn('USE_I18N', dir(settings))
|
||||
self.assertNotIn('USE_L10N', dir(settings))
|
||||
self.assertNotIn('USE_TZ', dir(settings))
|
||||
self.assertEqual(settings.USE_I18N, previous_i18n)
|
||||
self.assertEqual(settings.USE_L10N, previous_l10n)
|
||||
self.assertEqual(settings.USE_TZ, previous_tz)
|
||||
|
||||
def test_override_settings_nested(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user