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