mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
Updated test
This commit is contained in:
parent
2a12e39782
commit
69a1b35cfb
|
@ -1,13 +1,24 @@
|
||||||
import collections
|
import collections
|
||||||
import graphene
|
import graphene
|
||||||
|
import pytest
|
||||||
from graphene import Schema, relay, ObjectType
|
from graphene import Schema, relay, ObjectType
|
||||||
from django.test import TestCase, RequestFactory
|
from django.test import TestCase, RequestFactory
|
||||||
from graphene_django import DjangoObjectType
|
from graphene_django import DjangoObjectType
|
||||||
from graphene_django.auth.mixins import AuthNodeMixin, AuthMutationMixin
|
from graphene_django.auth.mixins import AuthNodeMixin, AuthMutationMixin
|
||||||
from graphene_django.auth.fields import AuthDjangoFilterConnectionField
|
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
from .models import Pet
|
from .models import Pet
|
||||||
|
|
||||||
|
from graphene_django.utils import DJANGO_FILTER_INSTALLED
|
||||||
|
|
||||||
|
pytestmark = []
|
||||||
|
|
||||||
|
if DJANGO_FILTER_INSTALLED:
|
||||||
|
from graphene_django.auth.fields import AuthDjangoFilterConnectionField
|
||||||
|
else:
|
||||||
|
pytestmark.append(pytest.mark.skipif(True, reason='django_filters not installed'))
|
||||||
|
|
||||||
|
pytestmark.append(pytest.mark.django_db)
|
||||||
|
|
||||||
|
|
||||||
class PetNode(AuthNodeMixin, DjangoObjectType):
|
class PetNode(AuthNodeMixin, DjangoObjectType):
|
||||||
_permission = 'app.view_pet'
|
_permission = 'app.view_pet'
|
Loading…
Reference in New Issue
Block a user