Home / Function/ test_routing_redirect_debugging() — flask Function Reference

test_routing_redirect_debugging() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  1da9f61a_6c57_8044_72bf_efb15d2fa9b8["test_routing_redirect_debugging()"]
  87d0a57b_be56_0b28_72a0_f6bd7a6fd678["test_basic.py"]
  1da9f61a_6c57_8044_72bf_efb15d2fa9b8 -->|defined in| 87d0a57b_be56_0b28_72a0_f6bd7a6fd678
  style 1da9f61a_6c57_8044_72bf_efb15d2fa9b8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_basic.py lines 1698–1715

def test_routing_redirect_debugging(monkeypatch, app, client):
    app.config["DEBUG"] = True

    @app.route("/user/", methods=["GET", "POST"])
    def user():
        return flask.request.form["status"]

    # default redirect code preserves form data
    rv = client.post("/user", data={"status": "success"}, follow_redirects=True)
    assert rv.data == b"success"

    # 301 and 302 raise error
    monkeypatch.setattr(RequestRedirect, "code", 301)

    with client, pytest.raises(AssertionError) as exc_info:
        client.post("/user", data={"status": "error"}, follow_redirects=True)

    assert "canonical URL 'http://localhost/user/'" in str(exc_info.value)

Subdomains

Defined In

Frequently Asked Questions

What does test_routing_redirect_debugging() do?
test_routing_redirect_debugging() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_routing_redirect_debugging() defined?
test_routing_redirect_debugging() is defined in tests/test_basic.py at line 1698.

Analyze Your Own Codebase

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

Try Supermodel Free