only strip one slash when registering blueprint

add test and changelog
This commit is contained in:
David Lord 2018-02-23 15:45:37 -08:00
parent 0887245bfd
commit 401423df06
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 20 additions and 4 deletions

View file

@ -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})