Skip to content

Commit 332214b

Browse files
authored
Merge pull request #751 from nxtman123/issue#750
Resolve #750 by editing assert message
2 parents 7bd77a0 + d6a81ee commit 332214b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

graphene/relay/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def get_node_from_global_id(cls, info, global_id, only_type=None):
101101

102102
if only_type:
103103
assert graphene_type == only_type, (
104-
'Must receive an {} id.'
105-
).format(graphene_type._meta.name)
104+
'Must receive a {} id.'
105+
).format(only_type._meta.name)
106106

107107
# We make sure the ObjectType implements the "Node" interface
108108
if cls not in graphene_type._meta.interfaces:

graphene/relay/tests/test_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_node_field_only_type_wrong():
115115
'{ onlyNode(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
116116
)
117117
assert len(executed.errors) == 1
118-
assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
118+
assert str(executed.errors[0]) == 'Must receive a MyNode id.'
119119
assert executed.data == {'onlyNode': None}
120120

121121

@@ -132,7 +132,7 @@ def test_node_field_only_lazy_type_wrong():
132132
'{ onlyNodeLazy(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
133133
)
134134
assert len(executed.errors) == 1
135-
assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
135+
assert str(executed.errors[0]) == 'Must receive a MyNode id.'
136136
assert executed.data == {'onlyNodeLazy': None}
137137

138138

0 commit comments

Comments
 (0)