@@ -829,6 +829,8 @@ def test_query_errors_non_atomic(set_rollback_mock, client):
829
829
set_rollback_mock .assert_not_called ()
830
830
831
831
832
+ validation_urls = ["/graphql/validation/" , "/graphql/validation/alternative/" ]
833
+
832
834
query_with_two_introspections = """
833
835
query Instrospection {
834
836
queryType: __schema {
@@ -856,22 +858,20 @@ def test_allow_introspection(client):
856
858
}
857
859
858
860
861
+ @pytest .mark .parametrize ("url" , validation_urls )
859
862
@pytest .mark .urls ("graphene_django.tests.urls_validation" )
860
- def test_validation_disallow_introspection (client ):
861
- response = client .post (
862
- url_string ("/graphql/validation/" , query = "{__schema {queryType {name}}}" )
863
- )
863
+ def test_validation_disallow_introspection (client , url ):
864
+ response = client .post (url_string (url , query = "{__schema {queryType {name}}}" ))
864
865
865
866
assert response .status_code == 400
866
867
assert introspection_disallow_error_message in response .content .decode ()
867
868
868
869
870
+ @pytest .mark .parametrize ("url" , validation_urls )
869
871
@pytest .mark .urls ("graphene_django.tests.urls_validation" )
870
872
@patch ("graphene_django.settings.graphene_settings.MAX_VALIDATION_ERRORS" , 2 )
871
- def test_within_max_validation_errors (client ):
872
- response = client .post (
873
- url_string ("/graphql/validation/" , query = query_with_two_introspections )
874
- )
873
+ def test_within_max_validation_errors (client , url ):
874
+ response = client .post (url_string (url , query = query_with_two_introspections ))
875
875
876
876
assert response .status_code == 400
877
877
@@ -881,12 +881,11 @@ def test_within_max_validation_errors(client):
881
881
assert max_validation_errors_exceeded_message not in text_response
882
882
883
883
884
+ @pytest .mark .parametrize ("url" , validation_urls )
884
885
@pytest .mark .urls ("graphene_django.tests.urls_validation" )
885
886
@patch ("graphene_django.settings.graphene_settings.MAX_VALIDATION_ERRORS" , 1 )
886
- def test_exceeds_max_validation_errors (client ):
887
- response = client .post (
888
- url_string ("/graphql/validation/" , query = query_with_two_introspections )
889
- )
887
+ def test_exceeds_max_validation_errors (client , url ):
888
+ response = client .post (url_string (url , query = query_with_two_introspections ))
890
889
891
890
assert response .status_code == 400
892
891
assert max_validation_errors_exceeded_message in response .content .decode ().lower ()
0 commit comments