mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-16 19:40:36 +03:00
Update test to a more real case scenario
This commit is contained in:
parent
aed2f78bdb
commit
8fbadee60c
|
@ -1590,21 +1590,22 @@ def test_connection_should_allow_offset_filtering_with_after():
|
||||||
|
|
||||||
|
|
||||||
def test_should_query_django_objecttype_fields_custom_meta():
|
def test_should_query_django_objecttype_fields_custom_meta():
|
||||||
class ArticleTypeOptions(DjangoObjectTypeOptions):
|
|
||||||
"""Article Type Options with extra fields"""
|
|
||||||
|
|
||||||
fields = yank_fields_from_attrs(
|
|
||||||
{"headline_with_lang": graphene.String()}, _as=graphene.Field,
|
|
||||||
)
|
|
||||||
|
|
||||||
class ArticleBaseType(DjangoObjectType):
|
class ArticleBaseType(DjangoObjectType):
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __init_subclass_with_meta__(cls, **options):
|
def __init_subclass_with_meta__(cls, _meta=None, **options):
|
||||||
options.setdefault("_meta", ArticleTypeOptions(cls))
|
if _meta is None:
|
||||||
super(ArticleBaseType, cls).__init_subclass_with_meta__(**options)
|
_meta = DjangoObjectTypeOptions(cls)
|
||||||
|
|
||||||
|
_meta.fields = yank_fields_from_attrs(
|
||||||
|
{"headline_with_lang": graphene.String()}, _as=graphene.Field,
|
||||||
|
)
|
||||||
|
|
||||||
|
super(ArticleBaseType, cls).__init_subclass_with_meta__(
|
||||||
|
_meta=_meta, **options
|
||||||
|
)
|
||||||
|
|
||||||
class ArticleCustomType(ArticleBaseType):
|
class ArticleCustomType(ArticleBaseType):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user