19
19
def app ():
20
20
return create_app ()
21
21
22
+
22
23
def url_string (** url_params ):
23
24
string = url_for ('graphql' )
24
25
@@ -328,7 +329,7 @@ def test_allows_post_with_get_operation_name(client):
328
329
329
330
330
331
@pytest .mark .parametrize ('app' , [create_app (pretty = True )])
331
- def test_supports_pretty_printing (client ):
332
+ def test_supports_pretty_printing (app , client ):
332
333
response = client .get (url_string (query = '{test}' ))
333
334
334
335
assert response .data .decode () == (
@@ -341,7 +342,7 @@ def test_supports_pretty_printing(client):
341
342
342
343
343
344
@pytest .mark .parametrize ('app' , [create_app (pretty = False )])
344
- def test_not_pretty_by_default (client ):
345
+ def test_not_pretty_by_default (app , client ):
345
346
response = client .get (url_string (query = '{test}' ))
346
347
347
348
assert response .data .decode () == (
@@ -451,11 +452,10 @@ def test_passes_request_into_request_context(client):
451
452
}
452
453
453
454
454
- @pytest .mark .parametrize ('app' , [create_app (get_context = lambda :"CUSTOM CONTEXT" )])
455
- def test_supports_pretty_printing ( client ):
455
+ @pytest .mark .parametrize ('app' , [create_app (get_context_value = lambda :"CUSTOM CONTEXT" )])
456
+ def test_supports_pretty_printing_with_custom_context ( app , client ):
456
457
response = client .get (url_string (query = '{context}' ))
457
458
458
-
459
459
assert response .status_code == 200
460
460
assert response_json (response ) == {
461
461
'data' : {
@@ -468,7 +468,7 @@ def test_post_multipart_data(client):
468
468
query = 'mutation TestMutation { writeTest { test } }'
469
469
response = client .post (
470
470
url_string (),
471
- data = {
471
+ data = {
472
472
'query' : query ,
473
473
'file' : (StringIO (), 'text1.txt' ),
474
474
},
@@ -480,7 +480,7 @@ def test_post_multipart_data(client):
480
480
481
481
482
482
@pytest .mark .parametrize ('app' , [create_app (batch = True )])
483
- def test_batch_allows_post_with_json_encoding (client ):
483
+ def test_batch_allows_post_with_json_encoding (app , client ):
484
484
response = client .post (
485
485
url_string (),
486
486
data = jl (
@@ -498,7 +498,7 @@ def test_batch_allows_post_with_json_encoding(client):
498
498
499
499
500
500
@pytest .mark .parametrize ('app' , [create_app (batch = True )])
501
- def test_batch_supports_post_json_query_with_json_variables (client ):
501
+ def test_batch_supports_post_json_query_with_json_variables (app , client ):
502
502
response = client .post (
503
503
url_string (),
504
504
data = jl (
@@ -514,10 +514,10 @@ def test_batch_supports_post_json_query_with_json_variables(client):
514
514
# 'id': 1,
515
515
'data' : {'test' : "Hello Dolly" }
516
516
}]
517
-
518
-
517
+
518
+
519
519
@pytest .mark .parametrize ('app' , [create_app (batch = True )])
520
- def test_batch_allows_post_with_operation_name (client ):
520
+ def test_batch_allows_post_with_operation_name (app , client ):
521
521
response = client .post (
522
522
url_string (),
523
523
data = jl (
0 commit comments