MCPcopy Create free account
hub / github.com/pallets/flask / test_max_content_length

Function test_max_content_length

tests/test_request.py:9–22  ·  view source on GitHub ↗
(app: Flask, client: FlaskClient)

Source from the content-addressed store, hash-verified

7
8
9def test_max_content_length(app: Flask, client: FlaskClient) -> None:
10 app.config["MAX_CONTENT_LENGTH"] = 50
11
12 @app.post("/")
13 def index():
14 request.form["myfile"]
15 AssertionError()
16
17 @app.errorhandler(413)
18 def catcher(error):
19 return "42"
20
21 rv = client.post("/", data={"myfile": "foo" * 50})
22 assert rv.data == b"42"
23
24
25def test_limit_config(app: Flask):

Callers

nothing calls this directly

Calls 1

postMethod · 0.45

Tested by

no test coverage detected