Merge pull request #751 from nxtman123/issue#750

Resolve #750 by editing assert message
This commit is contained in:
Syrus Akbary 2018-05-30 18:08:17 -07:00 committed by GitHub
commit 332214ba9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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}