Issue 9183: Intern UTC timezone.

This commit is contained in:
Alexander Belopolsky 2010-10-14 17:03:51 +00:00
parent 5bc4fa7a49
commit 1bcbaab15a
4 changed files with 60 additions and 31 deletions

View file

@ -176,7 +176,9 @@ class TestTimeZone(unittest.TestCase):
def test_constructor(self):
self.assertEqual(timezone.utc, timezone(timedelta(0)))
self.assertIs(timezone.utc, timezone(timedelta(0)))
self.assertIsNot(timezone.utc, timezone(timedelta(0), 'UTC'))
self.assertEqual(timezone.utc, timezone(timedelta(0), 'UTC'))
# invalid offsets
for invalid in [timedelta(microseconds=1), timedelta(1, 1),
timedelta(seconds=1), timedelta(1), -timedelta(1)]: