def test_from_python(self): ts = 1320283529 long_ts = '1320283529000' dt = datetime.fromtimestamp(ts) dtf = DateTimeField() self.assertEqual(dtf.from_python(dt), long_ts)
def test_to_python(self): ts = '1320283529000' isoformat = '2011-11-02T21:25:29' dtf = DateTimeField() dt = dtf.to_python(ts) self.assertEqual(dt.isoformat(), isoformat)