mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-15 14:42:06 +03:00
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()
This commit is contained in:
parent
e559a42374
commit
0d28630338
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user