Failing test of interface implementation registration.

This commit is contained in:
Marc Tamlyn 2016-05-26 12:16:45 +01:00
parent 8bc14953d7
commit aa2f4c5bac

View File

@ -132,6 +132,21 @@ def test_schema_register():
assert schema.get_type('MyType') == MyType
def test_schema_register_interfaces():
class Query(ObjectType):
f = Field(Character)
def resolve_f(self, args, info):
return Human()
schema = Schema(query=Query)
schema.register(Human)
result = schema.execute('{ f { name } }')
assert not result.errors
def test_schema_register_no_query_type():
schema = Schema(name='My own schema')