forked from orbit-oss/flask
Remove ending slash from static_url_path
This commit is contained in:
parent
7f98a28432
commit
2039e2e3b6
4 changed files with 15 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue