Home / Function/ test_max_cookie_size() — flask Function Reference

test_max_cookie_size() — flask Function Reference

Architecture documentation for the test_max_cookie_size() function in test_basic.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  3a5caace_5175_c7b1_cc6c_cccd27febc89["test_max_cookie_size()"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"]
  3a5caace_5175_c7b1_cc6c_cccd27febc89 -->|defined in| 85bc4fb5_d1d7_a135_020d_69e052c12c0f
  6ea1611d_2801_3cb5_a5b9_5b6403cc0537["index()"]
  3a5caace_5175_c7b1_cc6c_cccd27febc89 -->|calls| 6ea1611d_2801_3cb5_a5b9_5b6403cc0537
  style 3a5caace_5175_c7b1_cc6c_cccd27febc89 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_basic.py lines 1906–1933

def test_max_cookie_size(app, client, recwarn):
    app.config["MAX_COOKIE_SIZE"] = 100

    # outside app context, default to Werkzeug static value,
    # which is also the default config
    response = flask.Response()
    default = flask.Flask.default_config["MAX_COOKIE_SIZE"]
    assert response.max_cookie_size == default

    # inside app context, use app config
    with app.app_context():
        assert flask.Response().max_cookie_size == 100

    @app.route("/")
    def index():
        r = flask.Response("", status=204)
        r.set_cookie("foo", "bar" * 100)
        return r

    client.get("/")
    assert len(recwarn) == 1
    w = recwarn.pop()
    assert "cookie is too large" in str(w.message)

    app.config["MAX_COOKIE_SIZE"] = 0

    client.get("/")
    assert len(recwarn) == 0

Subdomains

Defined In

Calls

Frequently Asked Questions

What does test_max_cookie_size() do?
test_max_cookie_size() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_max_cookie_size() defined?
test_max_cookie_size() is defined in tests/test_basic.py at line 1906.
What does test_max_cookie_size() call?
test_max_cookie_size() calls 1 function(s): index.

Analyze Your Own Codebase

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

Try Supermodel Free