forked from orbit-oss/flask
add test for build error special values
This commit is contained in:
parent
19fbe3a18f
commit
e50767cfca
1 changed files with 17 additions and 0 deletions
|
|
@ -1131,6 +1131,23 @@ def test_build_error_handler_reraise():
|
||||||
pytest.raises(BuildError, flask.url_for, 'not.existing')
|
pytest.raises(BuildError, flask.url_for, 'not.existing')
|
||||||
|
|
||||||
|
|
||||||
|
def test_url_for_passes_special_values_to_build_error_handler():
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
|
@app.url_build_error_handlers.append
|
||||||
|
def handler(error, endpoint, values):
|
||||||
|
assert values == {
|
||||||
|
'_external': False,
|
||||||
|
'_anchor': None,
|
||||||
|
'_method': None,
|
||||||
|
'_scheme': None,
|
||||||
|
}
|
||||||
|
return 'handled'
|
||||||
|
|
||||||
|
with app.test_request_context():
|
||||||
|
flask.url_for('/')
|
||||||
|
|
||||||
|
|
||||||
def test_custom_converters():
|
def test_custom_converters():
|
||||||
from werkzeug.routing import BaseConverter
|
from werkzeug.routing import BaseConverter
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue