test_search_mixin.py 文件源码

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

项目:fleaker 作者: croscon 项目源码 文件源码
def test_search_fields_must_be_provided(post_model):
    """Ensure that search fields need to be set."""
    # Nothing is defined to search on, so error out
    with pytest.raises(AttributeError):
        post_model.search('hello')

    # If fields are provided, return a query
    assert isinstance(post_model.search('hello', fields=('body',)),
                      peewee.SelectQuery)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号