Commit 11ac7685 authored by Tres Seaver's avatar Tres Seaver

- Import SyntaxError from the module.

parent 3d2f31c3
...@@ -248,6 +248,7 @@ class DateTimeTests(unittest.TestCase): ...@@ -248,6 +248,7 @@ class DateTimeTests(unittest.TestCase):
def testISO8601(self): def testISO8601(self):
''' iso 8601 dates ''' ''' iso 8601 dates '''
from DateTime.DateTime import SyntaxError
ref0 = DateTime('2002/5/2 8:00am GMT') ref0 = DateTime('2002/5/2 8:00am GMT')
ref1 = DateTime('2002/5/2 8:00am US/Eastern') ref1 = DateTime('2002/5/2 8:00am US/Eastern')
...@@ -263,10 +264,10 @@ class DateTimeTests(unittest.TestCase): ...@@ -263,10 +264,10 @@ class DateTimeTests(unittest.TestCase):
dgood = '2002-05-02' dgood = '2002-05-02'
tgood = 'T08:00:00-04:00' tgood = 'T08:00:00-04:00'
for dbad in '2002-5-2', '2002-10-2', '2002-2-10', '02-2-10': for dbad in '2002-5-2', '2002-10-2', '2002-2-10', '02-2-10':
self.assertRaises(DateTime.SyntaxError, DateTime, dbad) self.assertRaises(SyntaxError, DateTime, dbad)
self.assertRaises(DateTime.SyntaxError, DateTime, dbad + tgood) self.assertRaises(SyntaxError, DateTime, dbad + tgood)
for tbad in '08:00', 'T8:00': #, 'T08:00Z-04:00': for tbad in '08:00', 'T8:00': #, 'T08:00Z-04:00':
self.assertRaises(DateTime.SyntaxError, DateTime, dgood + tbad) self.assertRaises(SyntaxError, DateTime, dgood + tbad)
def testJulianWeek(self): def testJulianWeek(self):
""" check JulianDayWeek function """ """ check JulianDayWeek function """
......
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