From cc45b0bcdbde8b8502c6da0927e853c10bc83830 Mon Sep 17 00:00:00 2001 From: Laurent Riviere Date: Thu, 18 Jan 2024 17:05:34 +0000 Subject: [PATCH] chore: improve test --- graphene_django/tests/test_fields.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphene_django/tests/test_fields.py b/graphene_django/tests/test_fields.py index e0d9ba6..0f5b79a 100644 --- a/graphene_django/tests/test_fields.py +++ b/graphene_django/tests/test_fields.py @@ -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