def test_can_encode_binary_body_with_header_charset(sample_app):
response = app.Response(
status_code=200,
body=b'foobar',
headers={'Content-Type': 'application/octet-stream; charset=binary'}
)
encoded_response = response.to_dict(sample_app.api.binary_types)
assert encoded_response['body'] == 'Zm9vYmFy'
评论列表
文章目录