File tree 1 file changed +11
-10
lines changed 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -1590,21 +1590,22 @@ class Query(graphene.ObjectType):
1590
1590
1591
1591
1592
1592
def test_should_query_django_objecttype_fields_custom_meta ():
1593
- class ArticleTypeOptions (DjangoObjectTypeOptions ):
1594
- """Article Type Options with extra fields"""
1595
-
1596
- fields = yank_fields_from_attrs (
1597
- {"headline_with_lang" : graphene .String ()}, _as = graphene .Field ,
1598
- )
1599
-
1600
1593
class ArticleBaseType (DjangoObjectType ):
1601
1594
class Meta :
1602
1595
abstract = True
1603
1596
1604
1597
@classmethod
1605
- def __init_subclass_with_meta__ (cls , ** options ):
1606
- options .setdefault ("_meta" , ArticleTypeOptions (cls ))
1607
- super (ArticleBaseType , cls ).__init_subclass_with_meta__ (** options )
1598
+ def __init_subclass_with_meta__ (cls , _meta = None , ** options ):
1599
+ if _meta is None :
1600
+ _meta = DjangoObjectTypeOptions (cls )
1601
+
1602
+ _meta .fields = yank_fields_from_attrs (
1603
+ {"headline_with_lang" : graphene .String ()}, _as = graphene .Field ,
1604
+ )
1605
+
1606
+ super (ArticleBaseType , cls ).__init_subclass_with_meta__ (
1607
+ _meta = _meta , ** options
1608
+ )
1608
1609
1609
1610
class ArticleCustomType (ArticleBaseType ):
1610
1611
class Meta :
You can’t perform that action at this time.
0 commit comments