mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #21281 -- Made override_settings act at class level when used as a TestCase decorator.
This commit is contained in:
parent
8b77b64f1c
commit
d89f56dc4d
9 changed files with 73 additions and 27 deletions
|
@ -20,6 +20,7 @@ class TzinfoTests(IgnoreDeprecationWarningsMixin, unittest.TestCase):
|
|||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TzinfoTests, cls).setUpClass()
|
||||
cls.old_TZ = os.environ.get('TZ')
|
||||
os.environ['TZ'] = 'US/Eastern'
|
||||
|
||||
|
@ -41,6 +42,7 @@ class TzinfoTests(IgnoreDeprecationWarningsMixin, unittest.TestCase):
|
|||
# Cleanup - force re-evaluation of TZ environment variable.
|
||||
if cls.tz_tests:
|
||||
time.tzset()
|
||||
super(TzinfoTests, cls).tearDownClass()
|
||||
|
||||
def test_fixedoffset(self):
|
||||
self.assertEqual(repr(FixedOffset(0)), '+0000')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue