File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import json
2+ import sys
23
34import pytest
45from django .utils .translation import gettext_lazy
89from .models import Film , Reporter
910from ..utils .testing import graphql_query
1011
12+ def call_args_compat (mock ):
13+ if sys .version_info < (3 , 8 ):
14+ setattr (mock .call_args , 'args' , mock .call_args [0 ])
15+ return mock .call_args
1116
1217def test_get_model_fields_no_duplication ():
1318 reporter_fields = get_model_fields (Reporter )
@@ -54,7 +59,7 @@ def runTest(self):
5459 tc ._pre_setup ()
5560 tc .setUpClass ()
5661 tc .query ("query { }" , operation_name = "QueryName" )
57- body = json .loads (post_mock . call_args .args [1 ])
62+ body = json .loads (call_args_compat ( post_mock ) .args [1 ])
5863 # `operationName` field from https://graphql.org/learn/serving-over-http/#post-request
5964 assert (
6065 "operationName" ,
@@ -66,7 +71,7 @@ def runTest(self):
6671@patch ("graphene_django.utils.testing.Client.post" )
6772def test_graphql_query_case_operation_name (post_mock ):
6873 graphql_query ("query { }" , operation_name = "QueryName" )
69- body = json .loads (post_mock . call_args .args [1 ])
74+ body = json .loads (call_args_compat ( post_mock ) .args [1 ])
7075 # `operationName` field from https://graphql.org/learn/serving-over-http/#post-request
7176 assert (
7277 "operationName" ,
You can’t perform that action at this time.
0 commit comments