mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 12:44:15 +03:00
add time query variable test
This commit is contained in:
parent
ad83a7e076
commit
4653a0e5df
|
@ -54,3 +54,18 @@ def test_datetime_query_variable():
|
|||
assert result.data == {
|
||||
'datetime': isoformat
|
||||
}
|
||||
|
||||
|
||||
def test_time_query_variable():
|
||||
now = datetime.datetime.now().replace(tzinfo=pytz.utc)
|
||||
time = datetime.time(now.hour, now.minute, now.second, now.microsecond, now.tzinfo)
|
||||
isoformat = time.isoformat()
|
||||
|
||||
result = schema.execute(
|
||||
'''query Test($date: Time){ time(at: $time) }''',
|
||||
variable_values={'time': isoformat}
|
||||
)
|
||||
assert not result.errors
|
||||
assert result.data == {
|
||||
'time': isoformat
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user