only strip one slash when registering blueprint
add test and changelog
This commit is contained in:
parent
0887245bfd
commit
401423df06
3 changed files with 20 additions and 4 deletions
|
|
@ -114,7 +114,20 @@ def test_blueprint_app_error_handling(app, client):
|
|||
assert client.get('/nope').data == b'you shall not pass'
|
||||
|
||||
|
||||
def test_blueprint_url_definitions(app, client):
|
||||
def test_blueprint_prefix_slash(app, client):
|
||||
bp = flask.Blueprint('test', __name__, url_prefix='/bar/')
|
||||
|
||||
@bp.route('/foo')
|
||||
def foo():
|
||||
return '', 204
|
||||
|
||||
app.register_blueprint(bp)
|
||||
app.register_blueprint(bp, url_prefix='/spam/')
|
||||
assert client.get('/bar/foo').status_code == 204
|
||||
assert client.get('/spam/foo').status_code == 204
|
||||
|
||||
|
||||
def test_blueprint_url_defaults(app, client):
|
||||
bp = flask.Blueprint('test', __name__)
|
||||
|
||||
@bp.route('/foo', defaults={'baz': 42})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue