From 79692f12e299c6a9084a25363e2dc4ef24a564fd Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Thu, 11 Jul 2019 14:44:12 +0300 Subject: [PATCH] Asserting status code before decoding json in assertResponseNoErrors --- graphene_django/utils/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/utils/testing.py b/graphene_django/utils/testing.py index db3e9f4..0fdac7e 100644 --- a/graphene_django/utils/testing.py +++ b/graphene_django/utils/testing.py @@ -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):