From 69a1b35cfb0fced71ccd46deee8edf3c70e42c37 Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Tue, 28 Mar 2017 20:00:39 -0500 Subject: [PATCH] Updated test --- .../tests/{notest_auth.py => test_auth.py} | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename graphene_django/tests/{notest_auth.py => test_auth.py} (96%) 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'