We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5b9b180 + 954b7ef commit f0c714aCopy full SHA for f0c714a
tests/test_blueprints.py
@@ -355,6 +355,25 @@ def foo_foo_foo():
355
rv = c.get('/py/bar/123')
356
assert rv.status_code == 404
357
358
+
359
+def test_endpoint_decorator():
360
+ from werkzeug.routing import Rule
361
+ app = flask.Flask(__name__)
362
+ app.url_map.add(Rule('/foo', endpoint='bar'))
363
364
+ bp = flask.Blueprint('bp', __name__)
365
366
+ @bp.endpoint('bar')
367
+ def foobar():
368
+ return flask.request.endpoint
369
370
+ app.register_blueprint(bp, url_prefix='/bp_prefix')
371
372
+ c = app.test_client()
373
+ assert c.get('/foo').data == b'bar'
374
+ assert c.get('/bp_prefix/bar').status_code == 404
375
376
377
def test_template_filter():
378
bp = flask.Blueprint('bp', __name__)
379
@bp.app_template_filter()
0 commit comments