Exemple #1
0
    def __new__(cls, value):
        dt = dates.parse_date(value)

        return datetime.date.__new__(cls,
                                     year=dt.year,
                                     month=dt.month,
                                     day=dt.day)
Exemple #2
0
 def test_parse_date_none(self):
     parsed = dates.parse_date(None)
     self.assertEqual(parsed, None)
Exemple #3
0
 def test_parse_date(self):
     dstr = "2015-04-01"
     parsed = dates.parse_date(dstr)
     self.assertEqual(dstr, parsed.isoformat())
Exemple #4
0
 def test_parse_date_none(self):
     parsed = dates.parse_date(None)
     self.assertEqual(parsed, None)
Exemple #5
0
 def test_parse_date(self):
     dstr = "2015-04-01"
     parsed = dates.parse_date(dstr)
     self.assertEqual(dstr, parsed.isoformat())