def test_datetime_conversion_idempotence(self): result = DateTime.convert(self.now) self.assertIsInstance(result, DateTime) self.assertEqual(self.now, result)
def setUp(self): self.now = DateTime.utcnow() self.epoch = DateTime(1970, 1, 1)
def test_datetime_conversion(self): dtime = datetime.utcnow() new_dtime = DateTime.convert(dtime) self.assertIsInstance(new_dtime, DateTime)