def test_date_format_aux_mk_time(self): date_string = '2012-4-7' try: result = aux_mk_time(date_string) except ValueError: self.fail("Didn't parse the date correctly") self.assertEqual(result, date(2012, 4, 7))
def test_date_format_aux_mk_time_old_version(self): # Tests the new implementation of aux_mk_time against the old version. date_string = '2012-03-28' aux_date = aux_mk_time(date_string) _date = time.mktime( time.strptime(date_string, settings.EFF_DATE_INPUT_FORMAT)) _date = date.fromtimestamp(_date) self.assertEqual(aux_date, _date)
def test_date_format_aux_mk_time_old_version(self): # Tests the new implementation of aux_mk_time against the old version. date_string = '2012-03-28' aux_date = aux_mk_time(date_string) _date = time.mktime(time.strptime(date_string, settings.EFF_DATE_INPUT_FORMAT)) _date = date.fromtimestamp(_date) self.assertEqual(aux_date, _date)