Skip to content

Commit

Permalink
added test for auto_camelcase flag
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed May 23, 2016
1 parent feb0825 commit 161f198
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions graphene/core/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ def test_schema_no_query():
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():
schema = Schema(name='My own schema')

Expand Down

0 comments on commit 161f198

Please sign in to comment.