Browse Source

add test for build error special values

pull/2017/head
David Lord 8 years ago
parent
commit
e50767cfca
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
  1. 17
      tests/test_basic.py

17
tests/test_basic.py

@ -1131,6 +1131,23 @@ def test_build_error_handler_reraise():
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():
from werkzeug.routing import BaseConverter

Loading…
Cancel
Save