mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 15:10:48 +03:00
Added failing test for JSONString
This commit is contained in:
parent
b8a9e454fa
commit
fb4077273d
|
@ -1,7 +1,7 @@
|
||||||
import iso8601
|
import iso8601
|
||||||
from graphql.language.ast import StringValue
|
from graphql.language.ast import StringValue
|
||||||
|
|
||||||
from ..custom_scalars import DateTime
|
from ..custom_scalars import DateTime, JSONString
|
||||||
|
|
||||||
|
|
||||||
def test_date_time():
|
def test_date_time():
|
||||||
|
@ -24,3 +24,16 @@ def test_date_time():
|
||||||
node = StringValue(test_iso_string)
|
node = StringValue(test_iso_string)
|
||||||
test_dt = DateTime.parse_literal(node)
|
test_dt = DateTime.parse_literal(node)
|
||||||
check_datetime(test_dt)
|
check_datetime(test_dt)
|
||||||
|
|
||||||
|
|
||||||
|
def test_json_string():
|
||||||
|
test_json_string = '{"foo": "bar"}'
|
||||||
|
|
||||||
|
test_object = JSONString().parse_value(test_json_string)
|
||||||
|
assert test_object == { 'foo': 'bar' }
|
||||||
|
|
||||||
|
assert JSONString.serialize(test_object) == test_json_string
|
||||||
|
|
||||||
|
node = StringValue(test_json_string)
|
||||||
|
test_object = JSONString.parse_literal(node)
|
||||||
|
assert test_object == { 'foo': 'bar' }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user