Commit cb8db59c authored by Laurence Rowe's avatar Laurence Rowe

tidy up legacy time zones

parent 167496f9
......@@ -150,7 +150,7 @@ class _timezone:
class _cache:
_zlst=['Brazil/Acre','Brazil/DeNoronha','Brazil/East',
_zlst=['Brazil/Acre','Brazil/East', #'Brazil/DeNoronha',
'Brazil/West','Canada/Atlantic','Canada/Central',
'Canada/Eastern','Canada/East-Saskatchewan',
'Canada/Mountain','Canada/Newfoundland',
......@@ -184,17 +184,17 @@ class _cache:
'MEWT','SWT','FWT','EET','EEST','BT','ZP4','ZP5','ZP6',
'WAST','CCT','JST','EAST','GST','NZT','NZST','IDLE']
_zmap={'aest':'GMT+1000', 'aedt':'GMT+1100',
'aus eastern standard time':'GMT+1000',
'sydney standard time':'GMT+1000',
'tasmania standard time':'GMT+1000',
'e. australia standard time':'GMT+1000',
_zmap={'aest':'GMT+10', 'aedt':'GMT+11',
'aus eastern standard time':'GMT+10',
'sydney standard time':'GMT+10',
'tasmania standard time':'GMT+10',
'e. australia standard time':'GMT+10',
'aus central standard time':'GMT+0930',
'cen. australia standard time':'GMT+0930',
'w. australia standard time':'GMT+0800',
'w. australia standard time':'GMT+8',
'brazil/acre':'Brazil/Acre',
'brazil/denoronha':'Brazil/Denoronha',
#'brazil/denoronha':'Brazil/Denoronha',
'brazil/east':'Brazil/East','brazil/west':'Brazil/West',
'canada/atlantic':'Canada/Atlantic',
'canada/central':'Canada/Central',
......@@ -203,7 +203,7 @@ class _cache:
'canada/mountain':'Canada/Mountain',
'canada/newfoundland':'Canada/Newfoundland',
'canada/pacific':'Canada/Pacific','canada/yukon':'Canada/Yukon',
'central europe standard time':'GMT+0100',
'central europe standard time':'GMT+1',
'chile/continental':'Chile/Continental',
'chile/easterisland':'Chile/EasterIsland',
'cst':'US/Central','cuba':'Cuba','est':'US/Eastern','egypt':'Egypt',
......
......@@ -17,7 +17,7 @@ import os
import time
import unittest
from DateTime.DateTime import _findLocalTimeZoneName
from DateTime.DateTime import _findLocalTimeZoneName, _cache
from DateTime import DateTime
from datetime import datetime
import pytz
......@@ -505,6 +505,14 @@ class DateTimeTests(unittest.TestCase):
dt4 = DateTime('2007-10-04T10:00:00+05:00')
sdt4 = datetime(2007, 10, 4, 5, 0)
self.assertEqual(dt4.utcdatetime(), sdt4)
def testLegacyTimezones(self):
# check that all the legacy timezone names can actually be looked up
cache = _cache()
for key in cache._zmap.keys():
tz = cache[key]
for key in cache._zlst:
tz = cache[key]
def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment