summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>2010-08-23 09:05:49 +0200
committerAlexandre Fayolle <alexandre.fayolle@logilab.fr>2010-08-23 09:05:49 +0200
commite88ea135e3d93f4f1584d14090f43b2cd467c7d7 (patch)
tree8bc0b4aac58141e052af8251789de75fc702dcfd /test
parent1facc67b4cc2a0362610e06aac4f764e517023ac (diff)
downloadlogilab-common-e88ea135e3d93f4f1584d14090f43b2cd467c7d7.tar.gz
new ustrftime implementation working around datetime limitaion on dates < 1900
Diffstat (limited to 'test')
-rw-r--r--test/unittest_date.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unittest_date.py b/test/unittest_date.py
index 88340c0..ec40a93 100644
--- a/test/unittest_date.py
+++ b/test/unittest_date.py
@@ -22,7 +22,7 @@ from logilab.common.testlib import TestCase, unittest_main
from logilab.common.date import date_range, endOfMonth
from logilab.common.date import add_days_worked, nb_open_days, \
- get_national_holidays
+ get_national_holidays, ustrftime
from datetime import date, datetime, timedelta
@@ -127,6 +127,10 @@ class DateTC(TestCase):
def test_open_days_afternoon(self):
self.assertOpenDays(self.datetimecls(2008, 5, 6, 14), self.datetimecls(2008, 5, 7, 14), 1)
+ def test_ustrftime_before_1900(self):
+ date = self.datetimecls(1328, 3, 12, 6, 30)
+ self.assertEquals(ustrftime(date, '%Y-%m-%d %H:%M:%S'), u'1328-03-12 06:30:00')
+
class MxDateTC(DateTC):
datecls = mxDate