Skip to content

Commit 0d28630

Browse files
tnightingaleulgens
authored andcommitted
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()
1 parent e559a42 commit 0d28630

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

graphene_django/utils/testing.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ class GraphQLTestCase(TestCase):
6868
# URL to graphql endpoint
6969
GRAPHQL_URL = DEFAULT_GRAPHQL_URL
7070

71-
@classmethod
72-
def setUpClass(cls):
73-
super(GraphQLTestCase, cls).setUpClass()
74-
75-
cls._client = Client()
76-
7771
def query(self, query, op_name=None, input_data=None, variables=None, headers=None):
7872
"""
7973
Args:
@@ -99,7 +93,7 @@ def query(self, query, op_name=None, input_data=None, variables=None, headers=No
9993
input_data=input_data,
10094
variables=variables,
10195
headers=headers,
102-
client=self._client,
96+
client=self.client,
10397
graphql_url=self.GRAPHQL_URL,
10498
)
10599

0 commit comments

Comments
 (0)