Asserting status code before decoding json in assertResponseNoErrors

This commit is contained in:
Semyon Pupkov 2019-07-11 14:44:12 +03:00
parent b7e4937775
commit 79692f12e2

View File

@ -54,8 +54,8 @@ class GraphQLTestCase(TestCase):
the call was fine. the call was fine.
:resp HttpResponse: Response :resp HttpResponse: Response
""" """
content = json.loads(resp.content)
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
content = json.loads(resp.content)
self.assertNotIn("errors", list(content.keys())) self.assertNotIn("errors", list(content.keys()))
def assertResponseHasErrors(self, resp): def assertResponseHasErrors(self, resp):