mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 17:47:12 +03:00
Fix ConnectionField Last Test
This commit is contained in:
parent
29935c2d33
commit
616c549d2c
|
@ -667,7 +667,7 @@ def test_should_query_promise_connectionfields():
|
|||
|
||||
def resolve_all_reporters(self, info, **args):
|
||||
return Promise.resolve([Reporter(id=1)])
|
||||
|
||||
|
||||
schema = graphene.Schema(query=Query)
|
||||
query = '''
|
||||
query ReporterPromiseConnectionQuery {
|
||||
|
@ -695,8 +695,14 @@ def test_should_query_promise_connectionfields():
|
|||
assert not result.errors
|
||||
assert result.data == expected
|
||||
|
||||
def test_should_query_promise_connectionfields_with_last():
|
||||
from promise import Promise
|
||||
def test_should_query_connectionfields_with_last():
|
||||
|
||||
r = Reporter.objects.create(
|
||||
first_name='John',
|
||||
last_name='Doe',
|
||||
email='johndoe@example.com',
|
||||
a_choice=1
|
||||
)
|
||||
|
||||
class ReporterType(DjangoObjectType):
|
||||
|
||||
|
@ -708,11 +714,11 @@ def test_should_query_promise_connectionfields_with_last():
|
|||
all_reporters = DjangoConnectionField(ReporterType)
|
||||
|
||||
def resolve_all_reporters(self, info, **args):
|
||||
return Promise.resolve([Reporter(id=1)])
|
||||
|
||||
return Reporter.objects.all()
|
||||
|
||||
schema = graphene.Schema(query=Query)
|
||||
query = '''
|
||||
query ReporterPromiseConnectionQuery {
|
||||
query ReporterLastQuery {
|
||||
allReporters(last: 1) {
|
||||
edges {
|
||||
node {
|
||||
|
|
Loading…
Reference in New Issue
Block a user