MCPcopy Create free account
hub / github.com/pallets/flask / test_specify_url_scheme

Function test_specify_url_scheme

tests/test_testing.py:90–99  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

88
89
90def test_specify_url_scheme(app, client):
91 @app.route("/")
92 def index():
93 return flask.request.url
94
95 ctx = app.test_request_context(url_scheme="https")
96 assert ctx.request.url == "https://localhost/"
97
98 rv = client.get("/", url_scheme="https")
99 assert rv.data == b"https://localhost/"
100
101
102def test_path_is_url(app):

Callers

nothing calls this directly

Calls 2

test_request_contextMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected