Asserting status code before decoding json in assertResponseNoEr… (#708)

This commit is contained in:
Semyon Pupkov 2019-07-11 22:32:07 +03:00 committed by Jonathan Kim
parent b7e4937775
commit 224725039b

View File

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