Remove ending slash from static_url_path

This commit is contained in:
Frankie Liu 2019-05-06 15:13:09 -04:00 committed by David Lord
parent 7f98a28432
commit 2039e2e3b6
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
4 changed files with 15 additions and 2 deletions

View file

@ -1399,6 +1399,17 @@ def test_static_url_path():
assert flask.url_for("static", filename="index.html") == "/foo/index.html"
def test_static_url_path_with_ending_slash():
app = flask.Flask(__name__, static_url_path="/foo/")
app.testing = True
rv = app.test_client().get("/foo/index.html")
assert rv.status_code == 200
rv.close()
with app.test_request_context():
assert flask.url_for("static", filename="index.html") == "/foo/index.html"
def test_static_route_with_host_matching():
app = flask.Flask(__name__, host_matching=True, static_host="example.com")
c = app.test_client()