def test_no_parse_json_content_with_bad_content_type(): request = Request() request.body = b'{"test": "test value"}' request.method = "POST" request.headers = {"Content-Type": "text/plain"} response = json_app3(request) assert response.body == b'{"test": "test value"}'
def test_parse_json_content(): request = Request() request.body = b'{"test": "test value"}' request.method = "POST" request.headers = {"Content-Type": "application/json"} response = json_app1(request) assert response.body == "test value"
def test_parse_json_content_with_charset(): request = Request() request.body = b'{"test": "test value"}' request.method = "POST" request.headers = {"Content-Type": "application/json; charset=UTF-8"} response = json_app1(request) assert response.body == "test value"
def test_preserve_raw_body(): request = Request() request.body = b'{"test": "test value"}' request.method = "POST" request.headers = {"Content-Type": "application/json"} response = json_app7(request) assert response.body == b'{"test": "test value"}'