Mercurial > p > roundup > code
comparison test/test_dates.py @ 2702:eb4e7b8d52a2
handle Py2.3+ datetime objects as Date specs [SF#971300]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 29 Sep 2004 07:27:09 +0000 |
| parents | 98d3bf8ffb19 |
| children | e28f047f87fa |
comparison
equal
deleted
inserted
replaced
| 2701:460c07a2dff1 | 2702:eb4e7b8d52a2 |
|---|---|
| 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.32 2004-04-18 05:31:03 richard Exp $ | 18 # $Id: test_dates.py,v 1.33 2004-09-29 07:27:09 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 |
| 370 ae('-00:00:30', 'just now') | 370 ae('-00:00:30', 'just now') |
| 371 ae('-1d', 'yesterday') | 371 ae('-1d', 'yesterday') |
| 372 ae('-1y', '1 year ago') | 372 ae('-1y', '1 year ago') |
| 373 ae('-2y', '2 years ago') | 373 ae('-2y', '2 years ago') |
| 374 | 374 |
| 375 def testPyDatetime(self): | |
| 376 try: | |
| 377 import datetime | |
| 378 except: | |
| 379 return | |
| 380 d = datetime.datetime.now() | |
| 381 Date(d) | |
| 382 | |
| 375 def test_suite(): | 383 def test_suite(): |
| 376 suite = unittest.TestSuite() | 384 suite = unittest.TestSuite() |
| 377 suite.addTest(unittest.makeSuite(DateTestCase)) | 385 suite.addTest(unittest.makeSuite(DateTestCase)) |
| 378 return suite | 386 return suite |
| 379 | 387 |
