diff -r 6fbe58966536 tests/regressiontests/forms/tests/fields.py
a
|
b
|
|
407 | 407 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 59), f.clean(datetime.datetime(2006, 10, 25, 14, 30, 59))) |
408 | 408 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 59, 200), f.clean(datetime.datetime(2006, 10, 25, 14, 30, 59, 200))) |
409 | 409 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 45, 200), f.clean('2006-10-25 14:30:45.000200')) |
| 410 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 45, 200), f.clean('2006-10-25 14:30:45.0002')) |
410 | 411 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 45), f.clean('2006-10-25 14:30:45')) |
411 | 412 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30), f.clean('2006-10-25 14:30:00')) |
412 | 413 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30), f.clean('2006-10-25 14:30')) |
… |
… |
|
452 | 453 | self.assertEqual(datetime.datetime(2006, 10, 25, 0, 0), f.clean(' 10/25/06 ')) |
453 | 454 | self.assertRaisesMessage(ValidationError, "[u'Enter a valid date/time.']", f.clean, ' ') |
454 | 455 | |
| 456 | def test_datetimefield_4(self): |
| 457 | f = DateTimeField(input_formats=[u'%Y.%m.%s %H:%M:%S.%f']) |
| 458 | self.assertEqual(datetime.datetime(2006, 10, 25, 14, 30, 45, 200), f.clean('2006.10.25 14:30:45.0002')) |
455 | 459 | # RegexField ################################################################## |
456 | 460 | |
457 | 461 | def test_regexfield_1(self): |