Skip to content

Commit

Permalink
Merge pull request #373 from pizzapanther/master
Browse files Browse the repository at this point in the history
add time query variable test
  • Loading branch information
syrusakbary committed Nov 23, 2016
2 parents 692d7e7 + 20ca849 commit 51c37fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions graphene/types/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 51c37fe

Please sign in to comment.