test_sanic.py 文件源码

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

项目:covador 作者: baverman 项目源码 文件源码
def test_form(test_cli):
    resp = yield from test_cli.post('/form/', data={'a': 2})
    assert resp.status == 200
    resp_json = yield from resp.json()
    assert resp_json == {'a': 2}

    body, mct = helpers.encode_multipart([('a', '2')])
    resp = yield from test_cli.post('/form/', data=body,
                                    headers={'Content-Type': mct})
    assert resp.status == 200
    resp_json = yield from resp.json()
    assert resp_json == {'a': 2}

    resp = yield from test_cli.post('/cbv/', data={'a': 2})
    assert resp.status == 200
    resp_json = yield from resp.json()
    assert resp_json == {'a': 2}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号