From 1eee2912d81e62d36babe0796718251c0be769de Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Fri, 2 Oct 2015 22:56:37 -0700 Subject: [PATCH] Added two more tests on field naming --- tests/core/test_fields.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/core/test_fields.py b/tests/core/test_fields.py index 31b08bc0..dce05ad2 100644 --- a/tests/core/test_fields.py +++ b/tests/core/test_fields.py @@ -51,6 +51,18 @@ def test_field_type(): assert f.internal_type(schema) == GraphQLString +def test_field_name_automatic_camelcase(): + f = Field(GraphQLString) + f.contribute_to_class(ot, 'field_name') + assert f.name == 'fieldName' + + +def test_field_name_use_name_if_exists(): + f = Field(GraphQLString, name='my_custom_name') + f.contribute_to_class(ot, 'field_name') + assert f.name == 'my_custom_name' + + def test_stringfield_type(): f = StringField() f.contribute_to_class(ot, 'field_name')