Completed FixedOffset test coverage.

This commit is contained in:
Hasan Ramezani 2018-10-10 02:32:08 +02:00 committed by Tim Graham
parent 3957f767bb
commit b5d7604cb0
1 changed files with 11 additions and 0 deletions

View File

@ -212,3 +212,14 @@ class TimezoneTests(SimpleTestCase):
with self.assertWarnsMessage(RemovedInDjango31Warning, msg) as cm:
timezone.FixedOffset()
self.assertEqual(cm.filename, __file__)
@ignore_warnings(category=RemovedInDjango31Warning)
def test_fixedoffset_utcoffset(self):
delta = datetime.timedelta(minutes=1)
self.assertEqual(timezone.FixedOffset(1).utcoffset(None), delta)
@ignore_warnings(category=RemovedInDjango31Warning)
def test_fixedoffset_dst(self):
ZERO = datetime.timedelta(minutes=0)
delta = datetime.timedelta(hours=0)
self.assertEqual(timezone.FixedOffset().dst(delta), ZERO)