mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-11-04 09:57:41 +03:00 
			
		
		
		
	Merge pull request #178 from AlecAivazis/master
Fixed bug when no middlewares are present
This commit is contained in:
		
						commit
						ed070b6a9a
					
				| 
						 | 
					@ -104,6 +104,22 @@ def test_schema_no_query():
 | 
				
			||||||
    assert 'define a base query type' in str(excinfo)
 | 
					    assert 'define a base query type' in str(excinfo)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_auto_camelcase_off():
 | 
				
			||||||
 | 
					    schema = Schema(name='My own schema', auto_camelcase=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    class Query(ObjectType):
 | 
				
			||||||
 | 
					        test_field = String(resolver=lambda *_: 'Dog')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    schema.query = Query
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    query = "query {test_field}"
 | 
				
			||||||
 | 
					    expected = {"test_field": "Dog"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    result = graphql(schema.schema, query, root_value=Query(object()))
 | 
				
			||||||
 | 
					    assert not result.errors
 | 
				
			||||||
 | 
					    assert result.data == expected
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_schema_register():
 | 
					def test_schema_register():
 | 
				
			||||||
    schema = Schema(name='My own schema')
 | 
					    schema = Schema(name='My own schema')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,6 +147,8 @@ class GroupNamedType(InstanceType):
 | 
				
			||||||
        name = type.name
 | 
					        name = type.name
 | 
				
			||||||
        if not name and schema.auto_camelcase:
 | 
					        if not name and schema.auto_camelcase:
 | 
				
			||||||
            name = to_camel_case(type.default_name)
 | 
					            name = to_camel_case(type.default_name)
 | 
				
			||||||
 | 
					        elif not name:
 | 
				
			||||||
 | 
					            name = type.default_name
 | 
				
			||||||
        return name, schema.T(type)
 | 
					        return name, schema.T(type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def iter_types(self, schema):
 | 
					    def iter_types(self, schema):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user