test_models.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:aiopeewee 作者: kszucs 项目源码 文件源码
def test_meta_remove_field():

    class _Model(Model):
        title = CharField(max_length=25)
        content = TextField(default='')

    _Model._meta.remove_field('content')
    assert 'content' not in _Model._meta.fields
    assert 'content' not in _Model._meta.sorted_field_names
    assert [f.name for f in _Model._meta.sorted_fields] == ['id', 'title']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号