From 0d2863033847874b663fcd562dc8cd7bf0b6c79b Mon Sep 17 00:00:00 2001 From: Tom Nightingale Date: Wed, 26 Feb 2020 17:04:58 -0800 Subject: [PATCH] Use the Django Client test utility instance that Django provides with its TestCase class. This allows GraphQL tests to make use of the stateful client methods like login() --- graphene_django/utils/testing.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/graphene_django/utils/testing.py b/graphene_django/utils/testing.py index 871c440..1c990dc 100644 --- a/graphene_django/utils/testing.py +++ b/graphene_django/utils/testing.py @@ -68,12 +68,6 @@ class GraphQLTestCase(TestCase): # URL to graphql endpoint GRAPHQL_URL = DEFAULT_GRAPHQL_URL - @classmethod - def setUpClass(cls): - super(GraphQLTestCase, cls).setUpClass() - - cls._client = Client() - def query(self, query, op_name=None, input_data=None, variables=None, headers=None): """ Args: @@ -99,7 +93,7 @@ class GraphQLTestCase(TestCase): input_data=input_data, variables=variables, headers=headers, - client=self._client, + client=self.client, graphql_url=self.GRAPHQL_URL, )