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