def test_date_to_timestamp(self): result = appier.date_to_timestamp("29/06/1984") self.assertEqual(type(result), int) self.assertEqual(int(result), 457315200) result = appier.date_to_timestamp("29/06/0000") self.assertEqual(result, None) result = appier.date_to_timestamp("1984-06-29", format="%Y-%m-%d") self.assertEqual(result, 457315200) result = appier.date_to_timestamp("1984-13-29", format="%Y-%m-%d") self.assertEqual(result, None)
def test_date_to_timestamp(self): result = appier.date_to_timestamp("29/06/1984") self.assertEqual(type(result), int) self.assertEqual(int(result), 457315200) result = appier.date_to_timestamp("29/06/0000") self.assertEqual(result, None) result = appier.date_to_timestamp("1984-06-29", format = "%Y-%m-%d") self.assertEqual(result, 457315200) result = appier.date_to_timestamp("1984-13-29", format = "%Y-%m-%d") self.assertEqual(result, None)