mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-12 13:14:23 +03:00
Add tests for validation_rules inherited from parent class
This commit is contained in:
parent
8eeffc77b5
commit
9561ec3bdd
|
@ -829,7 +829,11 @@ def test_query_errors_non_atomic(set_rollback_mock, client):
|
|||
set_rollback_mock.assert_not_called()
|
||||
|
||||
|
||||
validation_urls = ["/graphql/validation/", "/graphql/validation/alternative/"]
|
||||
validation_urls = [
|
||||
"/graphql/validation/",
|
||||
"/graphql/validation/alternative/",
|
||||
"/graphql/validation/inherited/",
|
||||
]
|
||||
|
||||
query_with_two_introspections = """
|
||||
query Instrospection {
|
||||
|
|
|
@ -10,12 +10,17 @@ class View(GraphQLView):
|
|||
schema = schema
|
||||
|
||||
|
||||
class NoIntroSpectionView(View):
|
||||
class NoIntrospectionView(View):
|
||||
validation_rules = (DisableIntrospection,)
|
||||
|
||||
|
||||
class NoIntrospectionViewInherited(NoIntrospectionView):
|
||||
pass
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("graphql/", View.as_view()),
|
||||
path("graphql/validation/", View.as_view(validation_rules=(DisableIntrospection,))),
|
||||
path("graphql/validation/alternative/", NoIntroSpectionView.as_view()),
|
||||
path("graphql/validation/alternative/", NoIntrospectionView.as_view()),
|
||||
path("graphql/validation/inherited/", NoIntrospectionViewInherited.as_view()),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user