test_elasticsearch.py 文件源码

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

项目:falcon-api 作者: Opentopic 项目源码 文件源码
def test_totals(connection, query_totals):
    """
    Test `get_object` func
    """
    totals, expected = query_totals
    if isinstance(totals, str):
        totals = json.loads(totals, object_pairs_hook=OrderedDict)
    if isinstance(expected, str):
        expected = json.loads(expected)
    c = CollectionResource(objects_class=Model, connection=connection)
    query_obj = c._build_total_expressions(Search(using=connection).doc_type(Model), totals)
    assert query_obj.to_dict() == expected
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号