diff --git a/graphene_django/tests/notest_auth.py b/graphene_django/tests/test_auth.py similarity index 96% rename from graphene_django/tests/notest_auth.py rename to graphene_django/tests/test_auth.py index 5c7710c..6921c4f 100644 --- a/graphene_django/tests/notest_auth.py +++ b/graphene_django/tests/test_auth.py @@ -1,13 +1,24 @@ import collections import graphene +import pytest from graphene import Schema, relay, ObjectType from django.test import TestCase, RequestFactory from graphene_django import DjangoObjectType from graphene_django.auth.mixins import AuthNodeMixin, AuthMutationMixin -from graphene_django.auth.fields import AuthDjangoFilterConnectionField from django.core.exceptions import PermissionDenied 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): _permission = 'app.view_pet'