test_full_event.py 文件源码

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

项目:postix 作者: c3cashdesk 项目源码 文件源码
def _simulate_preorder(self, client, product):
        secret = get_random_string(32)
        p = Preorder.objects.create(order_code=get_random_string(12), is_paid=True)
        p.positions.create(secret=secret, product=product)
        resp = client.post('/api/transactions/', json.dumps({
            "positions": [
                {"product": product.pk,
                 "price": "0.00",
                 "secret": secret,
                 "type": "redeem",
                 "_title": product.name}
            ]
        }), content_type="application/json")
        c = json.loads(resp.content.decode('utf-8'))
        assert c['success']
        return c['id']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号