test_engine_objects_integration.py 文件源码

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

项目:myreco 作者: dutradda 项目源码 文件源码
def test_post(self, init_db, client, headers, headers_without_content_type):
        client = await client
        body = [{
            'name': 'Top Seller Object Test',
            'type': 'top_seller_array',
            'configuration': {'days_interval': 7},
            'store_id': 1,
            'item_type_id': 1,
            'strategy_id': 1
        }]
        resp = await client.post('/engine_objects/', headers=headers, data=ujson.dumps(body))
        resp_json = (await resp.json())
        body[0]['id'] = 2
        body[0]['store'] = resp_json[0]['store']
        body[0]['strategy'] = resp_json[0]['strategy']
        body[0]['item_type'] = resp_json[0]['item_type']

        assert resp.status == 201
        assert resp_json ==  body
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号