Home / Function/ test_limit_config() — flask Function Reference

test_limit_config() — flask Function Reference

Architecture documentation for the test_limit_config() function in test_request.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  bc2b96cd_c908_100d_a547_00892566ffd6["test_limit_config()"]
  1905b6e1_8d46_0e59_4505_e8c353e23e05["test_request.py"]
  bc2b96cd_c908_100d_a547_00892566ffd6 -->|defined in| 1905b6e1_8d46_0e59_4505_e8c353e23e05
  style bc2b96cd_c908_100d_a547_00892566ffd6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_request.py lines 25–54

def test_limit_config(app: Flask):
    app.config["MAX_CONTENT_LENGTH"] = 100
    app.config["MAX_FORM_MEMORY_SIZE"] = 50
    app.config["MAX_FORM_PARTS"] = 3
    r = Request({})

    # no app context, use Werkzeug defaults
    assert r.max_content_length is None
    assert r.max_form_memory_size == 500_000
    assert r.max_form_parts == 1_000

    # in app context, use config
    with app.app_context():
        assert r.max_content_length == 100
        assert r.max_form_memory_size == 50
        assert r.max_form_parts == 3

    # regardless of app context, use override
    r.max_content_length = 90
    r.max_form_memory_size = 30
    r.max_form_parts = 4

    assert r.max_content_length == 90
    assert r.max_form_memory_size == 30
    assert r.max_form_parts == 4

    with app.app_context():
        assert r.max_content_length == 90
        assert r.max_form_memory_size == 30
        assert r.max_form_parts == 4

Subdomains

Frequently Asked Questions

What does test_limit_config() do?
test_limit_config() is a function in the flask codebase, defined in tests/test_request.py.
Where is test_limit_config() defined?
test_limit_config() is defined in tests/test_request.py at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free