Пример #1
0
def test_datetime_parser_raises_value_error_on_invalid_data():
    with pytest.raises(ValueError):
        parse_datetime_value("nothing")
Пример #2
0
def test_datetime_parser_returns_valid_date_from_date_iso8601_str(date):
    # time data is lost when datetime scalar receives date
    assert parse_datetime_value(date.isoformat()).date() == date
Пример #3
0
def test_datetime_parser_returns_valid_date_from_other_date_str(date):
    # time data is lost when datetime scalar receives date
    assert parse_datetime_value(date.strftime("%m/%d/%Y")).date() == date
Пример #4
0
def test_datetime_parser_returns_valid_date_from_datetime_iso8601_str(
        datetime):
    assert parse_datetime_value(datetime.isoformat()) == datetime