mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-17 03:50:41 +03:00
Fixed tests
This commit is contained in:
parent
2e1f154441
commit
b3fbac5818
|
@ -11,6 +11,7 @@ from graphene_django.tests.models import Article, Pet, Reporter
|
||||||
from graphene_django.utils import DJANGO_FILTER_INSTALLED
|
from graphene_django.utils import DJANGO_FILTER_INSTALLED
|
||||||
|
|
||||||
pytestmark = []
|
pytestmark = []
|
||||||
|
|
||||||
if DJANGO_FILTER_INSTALLED:
|
if DJANGO_FILTER_INSTALLED:
|
||||||
import django_filters
|
import django_filters
|
||||||
from graphene_django.filter import (GlobalIDFilter, DjangoFilterConnectionField,
|
from graphene_django.filter import (GlobalIDFilter, DjangoFilterConnectionField,
|
||||||
|
@ -22,7 +23,8 @@ else:
|
||||||
pytestmark.append(pytest.mark.django_db)
|
pytestmark.append(pytest.mark.django_db)
|
||||||
|
|
||||||
|
|
||||||
class ArticleNode(DjangoObjectType):
|
if DJANGO_FILTER_INSTALLED:
|
||||||
|
class ArticleNode(DjangoObjectType):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Article
|
model = Article
|
||||||
|
@ -30,20 +32,20 @@ class ArticleNode(DjangoObjectType):
|
||||||
filter_fields = ('headline', )
|
filter_fields = ('headline', )
|
||||||
|
|
||||||
|
|
||||||
class ReporterNode(DjangoObjectType):
|
class ReporterNode(DjangoObjectType):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Reporter
|
model = Reporter
|
||||||
interfaces = (Node, )
|
interfaces = (Node, )
|
||||||
|
|
||||||
|
|
||||||
class PetNode(DjangoObjectType):
|
class PetNode(DjangoObjectType):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Pet
|
model = Pet
|
||||||
interfaces = (Node, )
|
interfaces = (Node, )
|
||||||
|
|
||||||
# schema = Schema()
|
# schema = Schema()
|
||||||
|
|
||||||
|
|
||||||
def get_args(field):
|
def get_args(field):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user