| | 488 | |
| | 489 | def test_regexp_date_re(self): |
| | 490 | # valid formats |
| | 491 | self.assertIsNotNone(self.widget.date_re.match('2000-1-1')) # 1 digit for (day & month) |
| | 492 | self.assertIsNotNone(self.widget.date_re.match('2000-10-15')) # 2 digit for (day & month) |
| | 493 | self.assertIsNotNone(self.widget.date_re.match('2000-01-01')) # 2 digit for (day & month) starting on 0 |
| | 494 | self.assertIsNotNone(self.widget.date_re.match('2000-01-0')) # day not provided |
| | 495 | self.assertIsNotNone(self.widget.date_re.match('2000-0-01')) # month not provided |
| | 496 | self.assertIsNotNone(self.widget.date_re.match('0-01-01')) # year not provided |
| | 497 | self.assertIsNotNone(self.widget.date_re.match('2000-0-0')) # day & month not provided |
| | 498 | self.assertIsNotNone(self.widget.date_re.match('0-01-0')) # day & year not provided |
| | 499 | self.assertIsNotNone(self.widget.date_re.match('0-0-01')) # month & year not provided |
| | 500 | self.assertIsNotNone(self.widget.date_re.match('0-0-0')) # day, month & year not provided |
| | 501 | # invalid formats |
| | 502 | self.assertIsNone(self.widget.date_re.match('2000-01-001')) # invalid day |
| | 503 | self.assertIsNone(self.widget.date_re.match('2000-001-01')) # invalid month |
| | 504 | # invalid year formats (year accept only 4 digits or 0) |
| | 505 | self.assertIsNone(self.widget.date_re.match('2-01-01')) |
| | 506 | self.assertIsNone(self.widget.date_re.match('20-01-01')) |
| | 507 | self.assertIsNone(self.widget.date_re.match('200-01-01')) |
| | 508 | self.assertIsNone(self.widget.date_re.match('20000-01-01')) |