Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikwrede committed Oct 27, 2024
1 parent 009bd89 commit b073e85
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions graphene/types/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,15 @@ def test_time_query_variable(sample_time):


def test_support_isoformat():
isoformat = 20111104
isoformat = "2011-11-04T00:05:23Z"

# test time variable provided as Python time
result = schema.execute(
"""query Test($time: Time){ time(at: $time) }""",
variables={"time": sample_time},
)
assert not result.errors
assert result.data == {"time": isoformat}

# test time variable in string representation
result = schema.execute(
"""query Test($time: Time){ time(at: $time) }""", variables={"time": isoformat}
"""query DateTime($time: DateTime){ datetime(in: $time) }""",
variables={"time": isoformat},
)
assert not result.errors
assert result.data == {"time": isoformat}
assert result.data == {"datetime": "2011-11-04T00:05:23+00:00"}


def test_bad_variables(sample_date, sample_datetime, sample_time):
Expand Down

0 comments on commit b073e85

Please sign in to comment.