Refs #29514 -- Added test for get_default_timezone()/timezone.utc equality.

This commit is contained in:
Carlton Gibson 2018-06-28 09:30:10 -04:00 committed by Tim Graham
parent 2ec151e35d
commit f4ef71c689
1 changed files with 4 additions and 0 deletions

View File

@ -190,6 +190,10 @@ class TimezoneTests(SimpleTestCase):
def test_get_default_timezone(self): def test_get_default_timezone(self):
self.assertEqual(timezone.get_default_timezone_name(), 'America/Chicago') self.assertEqual(timezone.get_default_timezone_name(), 'America/Chicago')
def test_get_default_timezone_utc(self):
with override_settings(USE_TZ=True, TIME_ZONE='UTC'):
self.assertIs(timezone.get_default_timezone(), timezone.utc)
def test_fixedoffset_timedelta(self): def test_fixedoffset_timedelta(self):
delta = datetime.timedelta(hours=1) delta = datetime.timedelta(hours=1)
self.assertEqual(timezone.get_fixed_timezone(delta).utcoffset(''), delta) self.assertEqual(timezone.get_fixed_timezone(delta).utcoffset(''), delta)