Home / Function/ test_child_and_parent_subdomain() — flask Function Reference

test_child_and_parent_subdomain() — flask Function Reference

Architecture documentation for the test_child_and_parent_subdomain() function in test_blueprints.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  fb8967f8_c00f_9fab_cfa3_a712a4335d21["test_child_and_parent_subdomain()"]
  4366a441_d387_52f9_ec8d_1c41c71c00a8["test_blueprints.py"]
  fb8967f8_c00f_9fab_cfa3_a712a4335d21 -->|defined in| 4366a441_d387_52f9_ec8d_1c41c71c00a8
  style fb8967f8_c00f_9fab_cfa3_a712a4335d21 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_blueprints.py lines 1053–1072

def test_child_and_parent_subdomain(app, client) -> None:
    app.subdomain_matching = True
    app.config["SERVER_NAME"] = "example.test"
    client.allow_subdomain_redirects = True

    parent = flask.Blueprint("parent", __name__)
    child = flask.Blueprint("child", __name__, subdomain="api")

    @child.route("/")
    def index():
        return "child"

    parent.register_blueprint(child)
    app.register_blueprint(parent, subdomain="parent")

    response = client.get("/", base_url="http://api.parent.example.test")
    assert response.status_code == 200

    response = client.get("/", base_url="http://parent.example.test")
    assert response.status_code == 404

Subdomains

Frequently Asked Questions

What does test_child_and_parent_subdomain() do?
test_child_and_parent_subdomain() is a function in the flask codebase, defined in tests/test_blueprints.py.
Where is test_child_and_parent_subdomain() defined?
test_child_and_parent_subdomain() is defined in tests/test_blueprints.py at line 1053.

Analyze Your Own Codebase

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

Try Supermodel Free