Skip to content

Commit 2a322e5

Browse files
committed
test: Increase coverage of MongoengineConnectionField.get_query.
1 parent 41978ae commit 2a322e5

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

examples/flask_mongoengine/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
tasks {
3333
edges {
3434
node {
35-
id,
3635
name,
3736
deadline
3837
}

graphene_mongo/tests/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ class Player(Document):
6565
opponent = ReferenceField('Player')
6666
players = ListField(ReferenceField('Player'))
6767
articles = ListField(ReferenceField('Article'))
68+
embedded_list_articles = EmbeddedDocumentListField(EmbeddedArticle)
69+

graphene_mongo/tests/test_relay_query.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,13 @@ class Query(graphene.ObjectType):
382382
firstName
383383
}
384384
}
385+
},
386+
embeddedListArticles {
387+
edges {
388+
node {
389+
headline
390+
}
391+
}
385392
}
386393
}
387394
}
@@ -402,6 +409,9 @@ class Query(graphene.ObjectType):
402409
}
403410
}
404411
]
412+
},
413+
'embeddedListArticles': {
414+
'edges': []
405415
}
406416
}
407417
},
@@ -416,7 +426,11 @@ class Query(graphene.ObjectType):
416426
}
417427
}
418428
]
429+
},
430+
'embeddedListArticles': {
431+
'edges': []
419432
}
433+
420434
}
421435
},
422436
{
@@ -435,6 +449,9 @@ class Query(graphene.ObjectType):
435449
}
436450
}
437451
]
452+
},
453+
'embeddedListArticles': {
454+
'edges': []
438455
}
439456
}
440457
}
@@ -446,7 +463,6 @@ class Query(graphene.ObjectType):
446463
assert not result.errors
447464
assert json.dumps(result.data, sort_keys=True) == json.dumps(expected, sort_keys=True)
448465

449-
450466
# TODO:
451467
def test_should_paging():
452468
pass

0 commit comments

Comments
 (0)