mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-17 03:50:44 +03:00
added test for auto_camelcase flag
This commit is contained in:
parent
feb0825a63
commit
161f198451
|
@ -104,6 +104,21 @@ 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')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user