mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 09:36:44 +03:00
Merge pull request #751 from nxtman123/issue#750
Resolve #750 by editing assert message
This commit is contained in:
commit
332214ba9c
|
@ -101,8 +101,8 @@ class Node(AbstractNode):
|
|||
|
||||
if only_type:
|
||||
assert graphene_type == only_type, (
|
||||
'Must receive an {} id.'
|
||||
).format(graphene_type._meta.name)
|
||||
'Must receive a {} id.'
|
||||
).format(only_type._meta.name)
|
||||
|
||||
# We make sure the ObjectType implements the "Node" interface
|
||||
if cls not in graphene_type._meta.interfaces:
|
||||
|
|
|
@ -115,7 +115,7 @@ def test_node_field_only_type_wrong():
|
|||
'{ onlyNode(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
|
||||
)
|
||||
assert len(executed.errors) == 1
|
||||
assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
|
||||
assert str(executed.errors[0]) == 'Must receive a MyNode id.'
|
||||
assert executed.data == {'onlyNode': None}
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@ def test_node_field_only_lazy_type_wrong():
|
|||
'{ onlyNodeLazy(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
|
||||
)
|
||||
assert len(executed.errors) == 1
|
||||
assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
|
||||
assert str(executed.errors[0]) == 'Must receive a MyNode id.'
|
||||
assert executed.data == {'onlyNodeLazy': None}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user