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}
评论列表
文章目录