mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-16 19:12:21 +03:00
test: add test
This commit is contained in:
parent
cf29f5de15
commit
4077084d33
|
@ -299,3 +299,20 @@ def test_connectionfield_required():
|
|||
executed = schema.execute("{ testConnection { edges { cursor } } }")
|
||||
assert not executed.errors
|
||||
assert executed.data == {"testConnection": {"edges": []}}
|
||||
|
||||
|
||||
def test_connectionfield_strict_types():
|
||||
class MyObjectConnection(Connection):
|
||||
class Meta:
|
||||
node = MyObject
|
||||
strict_types = True
|
||||
|
||||
connection_field = ConnectionField(MyObjectConnection)
|
||||
edges_field_type = connection_field.type._meta.fields["edges"].type
|
||||
assert isinstance(edges_field_type, NonNull)
|
||||
|
||||
edges_list_element_type = edges_field_type.of_type.of_type
|
||||
assert isinstance(edges_list_element_type, NonNull)
|
||||
|
||||
node_field = edges_list_element_type.of_type._meta.fields["node"]
|
||||
assert isinstance(node_field.type, NonNull)
|
||||
|
|
Loading…
Reference in New Issue
Block a user