Test custom meta .setdefault()

This commit is contained in:
mongkok 2018-02-03 21:12:35 +05:30
parent e827b10e7b
commit 55dc65753e

View File

@ -76,9 +76,9 @@ def test_django_objecttype_with_custom_meta():
abstract = True abstract = True
@classmethod @classmethod
def __init_subclass_with_meta__(cls, _meta=None, **options): def __init_subclass_with_meta__(cls, **options):
_meta = ArticleTypeOptions(cls) options.setdefault('_meta', ArticleTypeOptions(cls))
super(ArticleType, cls).__init_subclass_with_meta__(_meta=_meta, **options) super(ArticleType, cls).__init_subclass_with_meta__(**options)
class Article(ArticleType): class Article(ArticleType):
class Meta: class Meta: