chore: fix test

This commit is contained in:
Erik Wrede 2024-10-27 20:49:38 +01:00
parent 009bd8994f
commit b073e85ea3
No known key found for this signature in database
GPG Key ID: 2180166EDF80A9DA

View File

@ -228,22 +228,15 @@ def test_time_query_variable(sample_time):
def test_support_isoformat(): def test_support_isoformat():
isoformat = 20111104 isoformat = "2011-11-04T00:05:23Z"
# test time variable provided as Python time # test time variable provided as Python time
result = schema.execute( result = schema.execute(
"""query Test($time: Time){ time(at: $time) }""", """query DateTime($time: DateTime){ datetime(in: $time) }""",
variables={"time": sample_time}, variables={"time": isoformat},
) )
assert not result.errors assert not result.errors
assert result.data == {"time": isoformat} assert result.data == {"datetime": "2011-11-04T00:05:23+00:00"}
# test time variable in string representation
result = schema.execute(
"""query Test($time: Time){ time(at: $time) }""", variables={"time": isoformat}
)
assert not result.errors
assert result.data == {"time": isoformat}
def test_bad_variables(sample_date, sample_datetime, sample_time): def test_bad_variables(sample_date, sample_datetime, sample_time):