chore: improve test

This commit is contained in:
Laurent Riviere 2024-01-18 17:05:34 +00:00
parent 4ac711c112
commit cc45b0bcdb

View File

@ -22,9 +22,14 @@ class TestDjangoListField:
class Query(ObjectType):
something = DjangoListField(String)
with pytest.raises(TypeError):
with pytest.raises(TypeError) as excinfo:
Schema(query=Query)
assert (
"Query fields cannot be resolved. DjangoListField only accepts DjangoObjectType types as underlying type"
in str(excinfo.value)
)
def test_only_import_paths(self):
list_field = DjangoListField("graphene_django.tests.schema.Human")
from .schema import Human