Merge pull request #373 from pizzapanther/master

add time query variable test
This commit is contained in:
Syrus Akbary 2016-11-23 08:26:31 -08:00 committed by GitHub
commit 51c37fef98

View File

@ -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($time: Time){ time(at: $time) }''',
variable_values={'time': isoformat}
)
assert not result.errors
assert result.data == {
'time': isoformat
}