Skip to content

Commit 3c11a98

Browse files
author
Ronny Vedrilla
committed
Python 2.7 syntax compat
1 parent b491878 commit 3c11a98

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

graphene_django/tests/base_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ class GraphQLTestCase(TestCase):
1717

1818
@classmethod
1919
def setUpClass(cls):
20-
super().setUpClass()
20+
super(GraphQLTestCase, cls).setUpClass()
2121

2222
if not cls.GRAPHQL_SCHEMA:
2323
raise AttributeError('Variable GRAPHQL_SCHEMA not defined in GraphQLTestCase.')
2424

2525
cls._client = Client(cls.GRAPHQL_SCHEMA)
2626

27-
def query(self, query: str, op_name: str = None, input_data: dict = None):
27+
def query(self, query, op_name=None, input_data=None):
2828
"""
2929
Args:
3030
query (string) - GraphQL query to run
@@ -47,18 +47,20 @@ def query(self, query: str, op_name: str = None, input_data: dict = None):
4747
content_type='application/json')
4848
return resp
4949

50-
def assertResponseNoErrors(self, resp: HttpResponse):
50+
def assertResponseNoErrors(self, resp):
5151
"""
5252
Assert that the call went through correctly. 200 means the syntax is ok, if there are no `errors`,
5353
the call was fine.
54+
:resp HttpResponse: Response
5455
"""
5556
content = json.loads(resp.content)
5657
self.assertEqual(resp.status_code, 200)
5758
self.assertNotIn('errors', list(content.keys()))
5859

59-
def assertResponseHasErrors(self, resp: HttpResponse):
60+
def assertResponseHasErrors(self, resp):
6061
"""
6162
Assert that the call was failing. Take care: Even with errors, GraphQL returns status 200!
63+
:resp HttpResponse: Response
6264
"""
6365
content = json.loads(resp.content)
6466
self.assertIn('errors', list(content.keys()))

0 commit comments

Comments
 (0)