comparison test/test_dates.py @ 3456:9c080e19f307

tighten up Date parsing to not allow 'M/D/YY' (or 'D/M/YY) [SF#1290550]
author Richard Jones <richard@users.sourceforge.net>
date Fri, 13 Jan 2006 00:22:17 +0000
parents d4d58c36d0bf
children f47bddab5a49
comparison
equal deleted inserted replaced
3455:e01bc6d65fa9 3456:9c080e19f307
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: test_dates.py,v 1.36 2005-02-25 17:18:46 a1s Exp $ 18 # $Id: test_dates.py,v 1.37 2006-01-13 00:22:17 richard Exp $
19 from __future__ import nested_scopes 19 from __future__ import nested_scopes
20 20
21 import unittest, time 21 import unittest, time
22 22
23 from roundup.date import Date, Interval, Range, fixTimeOverflow 23 from roundup.date import Date, Interval, Range, fixTimeOverflow
62 62
63 def testDateError(self): 63 def testDateError(self):
64 self.assertRaises(ValueError, Date, "12") 64 self.assertRaises(ValueError, Date, "12")
65 # Date cannot handle dates before UNIX epoch 65 # Date cannot handle dates before UNIX epoch
66 self.assertRaises(ValueError, Date, (1, 1, 1, 0, 0, 0.0, 0, 1, -1)) 66 self.assertRaises(ValueError, Date, (1, 1, 1, 0, 0, 0.0, 0, 1, -1))
67 self.assertRaises(ValueError, Date, "1/1/06")
67 68
68 def testOffset(self): 69 def testOffset(self):
69 ae = self.assertEqual 70 ae = self.assertEqual
70 date = Date("2000-04-17", -5) 71 date = Date("2000-04-17", -5)
71 ae(str(date), '2000-04-17.05:00:00') 72 ae(str(date), '2000-04-17.05:00:00')

Roundup Issue Tracker: http://roundup-tracker.org/