--- a/web/test/unittest_controller.py Mon May 04 15:49:20 2009 +0200
+++ b/web/test/unittest_controller.py Mon May 04 15:49:36 2009 +0200
@@ -9,13 +9,22 @@
from cubicweb.devtools import apptest
class BaseControllerTC(apptest.ControllerTC):
- def test_parse_datetime(self):
- self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24 12:18'), datetime)
- self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24'), datetime)
- self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24 12:18', 'Datetime'), datetime)
- self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24', 'Datetime'), datetime)
- self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24', 'Date'), date)
- self.assertIsInstance(self.ctrl.parse_datetime('12:18', 'Time'), time)
+
+ def test_parse_datetime_ok(self):
+ self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24 12:18'),
+ datetime)
+ self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24'),
+ date)
+ self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24 12:18', 'Datetime'),
+ datetime)
+ self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24', 'Datetime'),
+ datetime)
+ self.assertIsInstance(self.ctrl.parse_datetime('2006/06/24', 'Date'),
+ date)
+ self.assertIsInstance(self.ctrl.parse_datetime('12:18', 'Time'),
+ time)
+
+ def test_parse_datetime_ko(self):
self.assertRaises(ValueError,
self.ctrl.parse_datetime, '2006/06/24 12:188', 'Datetime')
self.assertRaises(ValueError,
@@ -28,6 +37,6 @@
self.ctrl.parse_datetime, '2006/06/240', 'Date')
self.assertRaises(ValueError,
self.ctrl.parse_datetime, '12:188', 'Time')
-
+
if __name__ == '__main__':
unittest_main()