forked from orbit-oss/flask
finish moving url_for to app
move entire implementation to app make special build args actual keyword-only args handle no app context in method mention other config in server_name error implicit external with scheme use adapter.build url_scheme argument rewrite documentation
This commit is contained in:
parent
92acd05d9b
commit
39f9363296
3 changed files with 185 additions and 152 deletions
|
|
@ -119,11 +119,15 @@ class TestUrlFor:
|
|||
)
|
||||
|
||||
def test_url_for_with_scheme_not_external(self, app, req_ctx):
|
||||
@app.route("/")
|
||||
def index():
|
||||
return "42"
|
||||
app.add_url_rule("/", endpoint="index")
|
||||
|
||||
pytest.raises(ValueError, flask.url_for, "index", _scheme="https")
|
||||
# Implicit external with scheme.
|
||||
url = flask.url_for("index", _scheme="https")
|
||||
assert url == "https://localhost/"
|
||||
|
||||
# Error when external=False with scheme
|
||||
with pytest.raises(ValueError):
|
||||
flask.url_for("index", _scheme="https", _external=False)
|
||||
|
||||
def test_url_for_with_alternating_schemes(self, app, req_ctx):
|
||||
@app.route("/")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue