(app, req_ctx)
| 1278 | |
| 1279 | |
| 1280 | def test_make_response_with_response_instance(app, req_ctx): |
| 1281 | rv = flask.make_response(flask.jsonify({"msg": "W00t"}), 400) |
| 1282 | assert rv.status_code == 400 |
| 1283 | assert rv.data == b'{"msg":"W00t"}\n' |
| 1284 | assert rv.mimetype == "application/json" |
| 1285 | |
| 1286 | rv = flask.make_response(flask.Response(""), 400) |
| 1287 | assert rv.status_code == 400 |
| 1288 | assert rv.data == b"" |
| 1289 | assert rv.mimetype == "text/html" |
| 1290 | |
| 1291 | rv = flask.make_response( |
| 1292 | flask.Response("", headers={"Content-Type": "text/html"}), |
| 1293 | 400, |
| 1294 | [("X-Foo", "bar")], |
| 1295 | ) |
| 1296 | assert rv.status_code == 400 |
| 1297 | assert rv.headers["Content-Type"] == "text/html" |
| 1298 | assert rv.headers["X-Foo"] == "bar" |
| 1299 | |
| 1300 | |
| 1301 | @pytest.mark.parametrize("compact", [True, False]) |
nothing calls this directly
no test coverage detected