@@ -166,7 +166,7 @@ def test_allows_mutation_to_exist_within_a_get(app):
166
166
def test_allows_post_with_json_encoding (app ):
167
167
_ , response = app .test_client .post (
168
168
uri = url_string (),
169
- data = json_dump_kwarg (query = "{test}" ),
169
+ content = json_dump_kwarg (query = "{test}" ),
170
170
headers = {"content-type" : "application/json" },
171
171
)
172
172
@@ -178,7 +178,7 @@ def test_allows_post_with_json_encoding(app):
178
178
def test_allows_sending_a_mutation_via_post (app ):
179
179
_ , response = app .test_client .post (
180
180
uri = url_string (),
181
- data = json_dump_kwarg (query = "mutation TestMutation { writeTest { test } }" ),
181
+ content = json_dump_kwarg (query = "mutation TestMutation { writeTest { test } }" ),
182
182
headers = {"content-type" : "application/json" },
183
183
)
184
184
@@ -194,7 +194,7 @@ def test_allows_post_with_url_encoding(app):
194
194
payload = "query={test}"
195
195
_ , response = app .test_client .post (
196
196
uri = url_string (),
197
- data = payload ,
197
+ content = payload ,
198
198
headers = {"content-type" : "application/x-www-form-urlencoded" },
199
199
)
200
200
@@ -206,7 +206,7 @@ def test_allows_post_with_url_encoding(app):
206
206
def test_supports_post_json_query_with_string_variables (app ):
207
207
_ , response = app .test_client .post (
208
208
uri = url_string (),
209
- data = json_dump_kwarg (
209
+ content = json_dump_kwarg (
210
210
query = "query helloWho($who: String){ test(who: $who) }" ,
211
211
variables = json .dumps ({"who" : "Dolly" }),
212
212
),
@@ -221,7 +221,7 @@ def test_supports_post_json_query_with_string_variables(app):
221
221
def test_supports_post_json_query_with_json_variables (app ):
222
222
_ , response = app .test_client .post (
223
223
uri = url_string (),
224
- data = json_dump_kwarg (
224
+ content = json_dump_kwarg (
225
225
query = "query helloWho($who: String){ test(who: $who) }" ,
226
226
variables = {"who" : "Dolly" },
227
227
),
@@ -236,7 +236,7 @@ def test_supports_post_json_query_with_json_variables(app):
236
236
def test_supports_post_url_encoded_query_with_string_variables (app ):
237
237
_ , response = app .test_client .post (
238
238
uri = url_string (),
239
- data = urlencode (
239
+ content = urlencode (
240
240
dict (
241
241
query = "query helloWho($who: String){ test(who: $who) }" ,
242
242
variables = json .dumps ({"who" : "Dolly" }),
@@ -253,7 +253,7 @@ def test_supports_post_url_encoded_query_with_string_variables(app):
253
253
def test_supports_post_json_query_with_get_variable_values (app ):
254
254
_ , response = app .test_client .post (
255
255
uri = url_string (variables = json .dumps ({"who" : "Dolly" })),
256
- data = json_dump_kwarg (
256
+ content = json_dump_kwarg (
257
257
query = "query helloWho($who: String){ test(who: $who) }" ,
258
258
),
259
259
headers = {"content-type" : "application/json" },
@@ -267,7 +267,7 @@ def test_supports_post_json_query_with_get_variable_values(app):
267
267
def test_post_url_encoded_query_with_get_variable_values (app ):
268
268
_ , response = app .test_client .post (
269
269
uri = url_string (variables = json .dumps ({"who" : "Dolly" })),
270
- data = urlencode (
270
+ content = urlencode (
271
271
dict (
272
272
query = "query helloWho($who: String){ test(who: $who) }" ,
273
273
)
@@ -283,7 +283,7 @@ def test_post_url_encoded_query_with_get_variable_values(app):
283
283
def test_supports_post_raw_text_query_with_get_variable_values (app ):
284
284
_ , response = app .test_client .post (
285
285
uri = url_string (variables = json .dumps ({"who" : "Dolly" })),
286
- data = "query helloWho($who: String){ test(who: $who) }" ,
286
+ content = "query helloWho($who: String){ test(who: $who) }" ,
287
287
headers = {"content-type" : "application/graphql" },
288
288
)
289
289
@@ -295,7 +295,7 @@ def test_supports_post_raw_text_query_with_get_variable_values(app):
295
295
def test_allows_post_with_operation_name (app ):
296
296
_ , response = app .test_client .post (
297
297
uri = url_string (),
298
- data = json_dump_kwarg (
298
+ content = json_dump_kwarg (
299
299
query = """
300
300
query helloYou { test(who: "You"), ...shared }
301
301
query helloWorld { test(who: "World"), ...shared }
@@ -319,7 +319,7 @@ def test_allows_post_with_operation_name(app):
319
319
def test_allows_post_with_get_operation_name (app ):
320
320
_ , response = app .test_client .post (
321
321
uri = url_string (operationName = "helloWorld" ),
322
- data = """
322
+ content = """
323
323
query helloYou { test(who: "You"), ...shared }
324
324
query helloWorld { test(who: "World"), ...shared }
325
325
query helloDolly { test(who: "Dolly"), ...shared }
@@ -404,7 +404,7 @@ def test_handles_errors_caused_by_a_lack_of_query(app):
404
404
@pytest .mark .parametrize ("app" , [create_app ()])
405
405
def test_handles_batch_correctly_if_is_disabled (app ):
406
406
_ , response = app .test_client .post (
407
- uri = url_string (), data = "[]" , headers = {"content-type" : "application/json" }
407
+ uri = url_string (), content = "[]" , headers = {"content-type" : "application/json" }
408
408
)
409
409
410
410
assert response .status == 400
@@ -420,7 +420,9 @@ def test_handles_batch_correctly_if_is_disabled(app):
420
420
@pytest .mark .parametrize ("app" , [create_app ()])
421
421
def test_handles_incomplete_json_bodies (app ):
422
422
_ , response = app .test_client .post (
423
- uri = url_string (), data = '{"query":' , headers = {"content-type" : "application/json" }
423
+ uri = url_string (),
424
+ content = '{"query":' ,
425
+ headers = {"content-type" : "application/json" },
424
426
)
425
427
426
428
assert response .status == 400
@@ -433,7 +435,7 @@ def test_handles_incomplete_json_bodies(app):
433
435
def test_handles_plain_post_text (app ):
434
436
_ , response = app .test_client .post (
435
437
uri = url_string (variables = json .dumps ({"who" : "Dolly" })),
436
- data = "query helloWho($who: String){ test(who: $who) }" ,
438
+ content = "query helloWho($who: String){ test(who: $who) }" ,
437
439
headers = {"content-type" : "text/plain" },
438
440
)
439
441
assert response .status == 400
@@ -530,7 +532,7 @@ def test_post_multipart_data(app):
530
532
531
533
_ , response = app .test_client .post (
532
534
uri = url_string (),
533
- data = data ,
535
+ content = data ,
534
536
headers = {"content-type" : "multipart/form-data; boundary=----sanicgraphql" },
535
537
)
536
538
@@ -542,7 +544,7 @@ def test_post_multipart_data(app):
542
544
def test_batch_allows_post_with_json_encoding (app ):
543
545
_ , response = app .test_client .post (
544
546
uri = url_string (),
545
- data = json_dump_kwarg_list (id = 1 , query = "{test}" ),
547
+ content = json_dump_kwarg_list (id = 1 , query = "{test}" ),
546
548
headers = {"content-type" : "application/json" },
547
549
)
548
550
@@ -554,7 +556,7 @@ def test_batch_allows_post_with_json_encoding(app):
554
556
def test_batch_supports_post_json_query_with_json_variables (app ):
555
557
_ , response = app .test_client .post (
556
558
uri = url_string (),
557
- data = json_dump_kwarg_list (
559
+ content = json_dump_kwarg_list (
558
560
id = 1 ,
559
561
query = "query helloWho($who: String){ test(who: $who) }" ,
560
562
variables = {"who" : "Dolly" },
@@ -570,7 +572,7 @@ def test_batch_supports_post_json_query_with_json_variables(app):
570
572
def test_batch_allows_post_with_operation_name (app ):
571
573
_ , response = app .test_client .post (
572
574
uri = url_string (),
573
- data = json_dump_kwarg_list (
575
+ content = json_dump_kwarg_list (
574
576
id = 1 ,
575
577
query = """
576
578
query helloYou { test(who: "You"), ...shared }
0 commit comments