def test_timestamp_in_microseconds(self): self.assertEqual( date.get_date_from_timestamp('1570308760263111', None), datetime.fromtimestamp(1570308760).replace(microsecond=263111))
def test_timestamp_with_wrong_length(self, date_string): self.assertEqual(date.get_date_from_timestamp(date_string, None), None)
def test_timestamp_in_milliseconds(self): self.assertEqual( date.get_date_from_timestamp(u'1570308760263', None), datetime.utcfromtimestamp(1570308760).replace(microsecond=263000) )