Skip to content

Commit 51c37fe

Browse files
authored
Merge pull request #373 from pizzapanther/master
add time query variable test
2 parents 692d7e7 + 20ca849 commit 51c37fe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

graphene/types/tests/test_datetime.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,18 @@ def test_datetime_query_variable():
5454
assert result.data == {
5555
'datetime': isoformat
5656
}
57+
58+
59+
def test_time_query_variable():
60+
now = datetime.datetime.now().replace(tzinfo=pytz.utc)
61+
time = datetime.time(now.hour, now.minute, now.second, now.microsecond, now.tzinfo)
62+
isoformat = time.isoformat()
63+
64+
result = schema.execute(
65+
'''query Test($time: Time){ time(at: $time) }''',
66+
variable_values={'time': isoformat}
67+
)
68+
assert not result.errors
69+
assert result.data == {
70+
'time': isoformat
71+
}

0 commit comments

Comments
 (0)