Skip to content

Commit d14a732

Browse files
committed
test: Remove _get_nodes
1 parent d01e144 commit d14a732

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

graphene_mongo/tests/test_relay_query.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
from ..fields import MongoengineConnectionField
1313

1414

15-
def _get_nodes(data, key):
16-
return map(lambda edge: edge['node'], data[key]['edges'])
17-
18-
1915
def test_should_query_reporter(fixtures):
2016

2117
class Query(graphene.ObjectType):
@@ -555,13 +551,13 @@ class Query(graphene.ObjectType):
555551
'editors': {
556552
'edges': [
557553
{
558-
'cursor': 'xxx',
554+
'cursor': 'YXJyYXljb25uZWN0aW9uOjA=',
559555
'node': {
560556
'firstName': 'Penny'
561557
}
562558
},
563559
{
564-
'cursor': 'xxx',
560+
'cursor': 'YXJyYXljb25uZWN0aW9uOjE=',
565561
'node': {
566562
'firstName': 'Grant'
567563
}
@@ -570,17 +566,16 @@ class Query(graphene.ObjectType):
570566
'pageInfo': {
571567
'hasNextPage': True,
572568
'hasPreviousPage': False,
573-
'startCursor': 'xxx',
574-
'endCursor': 'xxx'
569+
'startCursor': 'YXJyYXljb25uZWN0aW9uOjA=',
570+
'endCursor': 'YXJyYXljb25uZWN0aW9uOjE='
575571
}
576572
}
577573
}
578574
schema = graphene.Schema(query=Query)
579575
result = schema.execute(query)
580576

581577
assert not result.errors
582-
assert all(item in _get_nodes(result.data, 'editors')
583-
for item in _get_nodes(expected, 'editors'))
578+
assert result.data == expected
584579

585580

586581
def test_should_after(fixtures):

0 commit comments

Comments
 (0)