MCPcopy
hub / github.com/pallets/flask / test_basic_url_generation

Function test_basic_url_generation

tests/test_appctx.py:8–18  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

6
7
8def test_basic_url_generation(app):
9 app.config["SERVER_NAME"] = "localhost"
10 app.config["PREFERRED_URL_SCHEME"] = "https"
11
12 @app.route("/")
13 def index():
14 pass
15
16 with app.app_context():
17 rv = flask.url_for("index")
18 assert rv == "https://localhost/"
19
20
21def test_url_generation_requires_server_name(app):

Callers

nothing calls this directly

Calls 2

app_contextMethod · 0.80
url_forMethod · 0.80

Tested by

no test coverage detected