def test_datetime_converter(fragment, format_string, expected): c = converters.DateTimeConverter(format_string) assert c.convert(fragment) == expected
def test_datetime_converter_default_format(): c = converters.DateTimeConverter() assert c.convert('2017-07-03T14:30:01Z') == datetime(2017, 7, 3, 14, 30, 1)
def test_datetime_converter(value, format_string, expected): c = converters.DateTimeConverter(format_string) assert c.convert(value) == expected