Fixed #21281 -- Made override_settings act at class level when used as a TestCase decorator.

This commit is contained in:
Thomas Chaumeny 2014-10-18 20:03:10 +02:00 committed by Tim Graham
parent 8b77b64f1c
commit d89f56dc4d
9 changed files with 73 additions and 27 deletions

View file

@ -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')