mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-10-31 07:57:26 +03:00 
			
		
		
		
	Added two more tests on field naming
This commit is contained in:
		
							parent
							
								
									701c49db26
								
							
						
					
					
						commit
						1eee2912d8
					
				|  | @ -51,6 +51,18 @@ def test_field_type(): | ||||||
|     assert f.internal_type(schema) == GraphQLString |     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(): | def test_stringfield_type(): | ||||||
|     f = StringField() |     f = StringField() | ||||||
|     f.contribute_to_class(ot, 'field_name') |     f.contribute_to_class(ot, 'field_name') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user