Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit f9f21d4

Browse files
committed
Fixed tests
1 parent 218b806 commit f9f21d4

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

examples/starwars/schema.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class Input:
4343
faction = graphene.Field(Faction)
4444

4545
@classmethod
46-
def mutate_and_get_payload(cls, info, **input):
47-
ship_name = input.get('ship_name')
48-
faction_id = input.get('faction_id')
46+
def mutate_and_get_payload(cls, root, info, ship_name, faction_id, client_mutation_id=None):
4947
faction_key = ndb.Key(FactionModel, faction_id)
5048
ship = create_ship(ship_name, faction_key)
5149
faction = faction_key.get()

graphene_gae/ndb/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def is_type_of(cls, root, info):
114114
return type(root) == cls._meta.model
115115

116116
@classmethod
117-
def get_node(cls, urlsafe_key, *_):
117+
def get_node(cls, info, urlsafe_key):
118118
try:
119119
key = ndb.Key(urlsafe=urlsafe_key)
120120
except:

tests/_ndb/test_types_relay.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ class QueryRoot(graphene.ObjectType):
8989
class TestNDBTypesRelay(BaseTest):
9090

9191
def testNdbNode_getNode_invalidId_shouldReturnNone(self):
92-
result = ArticleType.get_node("I'm not a valid NDB encoded key")
92+
result = ArticleType.get_node(None, "I'm not a valid NDB encoded key")
9393
self.assertIsNone(result)
9494

9595
def testNdbNode_getNode_validID_entityDoesntExist_shouldReturnNone(self):
9696
article_key = ndb.Key('Article', 'invalid_id_thats_not_in_db')
97-
result = ArticleType.get_node(article_key.urlsafe())
97+
result = ArticleType.get_node(None, article_key.urlsafe())
9898
self.assertIsNone(result)
9999

100100
def testNdbNode_getNode_validID_entityDoes_shouldReturnEntity(self):
@@ -104,7 +104,7 @@ def testNdbNode_getNode_validID_entityDoes_shouldReturnEntity(self):
104104
author_key=Author(name="John Dow", email="[email protected]").put(),
105105
).put()
106106

107-
result = ArticleType.get_node(article_key.urlsafe())
107+
result = ArticleType.get_node(None, article_key.urlsafe())
108108
article = article_key.get()
109109

110110
self.assertIsNotNone(result)

0 commit comments

Comments
 (0)