def test_iso_format_with_time_zone_case_1(): # python -m pytest tests/unit/time/test_datetime.py -s -v -k test_iso_format_with_time_zone_case_1 expected = DateTime(2019, 10, 30, 7, 54, 2.129790999, tzinfo=timezone_utc) assert expected.iso_format() == "2019-10-30T07:54:02.129790999+00:00" assert expected.tzinfo == FixedOffset(0) actual = DateTime.from_iso_format("2019-10-30T07:54:02.129790999+00:00") assert expected == actual
def test_iso_format_with_trailing_zeroes(self): dt = DateTime(2018, 10, 1, 12, 34, 56.789) self.assertEqual("2018-10-01T12:34:56.789000000", dt.iso_format())
def test_iso_format(self): dt = DateTime(2018, 10, 1, 12, 34, 56.789123456) self.assertEqual("2018-10-01T12:34:56.789123456", dt.iso_format())