From b5d7604cb0c130af1d7378496a69dc481d72a197 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Wed, 10 Oct 2018 02:32:08 +0200 Subject: [PATCH] Completed FixedOffset test coverage. --- tests/utils_tests/test_timezone.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/utils_tests/test_timezone.py b/tests/utils_tests/test_timezone.py index 11c754f1e7c..c6e5ece6c4d 100644 --- a/tests/utils_tests/test_timezone.py +++ b/tests/utils_tests/test_timezone.py @@ -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)