forked from orbit-oss/flask
fix 'static_url_path' defaulting for empty paths
-prefix a path delimiter iff there's a path to delimit -ensures a valid default static route rule is created on application intialisation for the case 'static_folder=""' and implicit 'static_url_path'
This commit is contained in:
parent
b83760675d
commit
a12bf290da
2 changed files with 16 additions and 1 deletions
|
|
@ -1427,6 +1427,20 @@ def test_static_url_path_with_ending_slash():
|
|||
assert flask.url_for("static", filename="index.html") == "/foo/index.html"
|
||||
|
||||
|
||||
def test_static_url_null_path(app):
|
||||
app = flask.Flask(__name__, static_folder='', static_url_path='')
|
||||
rv = app.test_client().open('/static/index.html', method='GET')
|
||||
assert rv.status_code == 200
|
||||
rv.close()
|
||||
|
||||
|
||||
def test_static_url_null_path_defaulting(app):
|
||||
app = flask.Flask(__name__, static_folder='')
|
||||
rv = app.test_client().open('/static/index.html', method='GET')
|
||||
assert rv.status_code == 200
|
||||
rv.close()
|
||||
|
||||
|
||||
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