|
|
|
@ -772,6 +772,17 @@ class BasicFunctionalityTestCase(FlaskTestCase):
|
|
|
|
|
with app.test_request_context(): |
|
|
|
|
self.assert_equal(flask.url_for('spam'), '/test_handler/') |
|
|
|
|
|
|
|
|
|
def test_build_error_handler_reraise(self): |
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
|
|
# Test a custom handler which reraises the BuildError |
|
|
|
|
def handler_raises_build_error(error, endpoint, values): |
|
|
|
|
raise error |
|
|
|
|
app.url_build_error_handlers.append(handler_raises_build_error) |
|
|
|
|
|
|
|
|
|
with app.test_request_context(): |
|
|
|
|
self.assertRaises(BuildError, flask.url_for, 'not.existing') |
|
|
|
|
|
|
|
|
|
def test_custom_converters(self): |
|
|
|
|
from werkzeug.routing import BaseConverter |
|
|
|
|
class ListConverter(BaseConverter): |
|
|
|
|