def test_to(self): dt = datetime(2011, 1, 1) self.assertEquals(dump_timestamp(dt), '\x00\x00\x00\x00M\x1e`p')
def test_from_to(self): dt = datetime(2011, 1, 1, 10, 5) dt2, offset = parse_timestamp(dump_timestamp(dt), 0) self.assertEquals(dt, dt2)