Added support for anchor link generation.

This commit is contained in:
Armin Ronacher 2011-10-06 10:57:03 -04:00
parent d04c9a61e3
commit 1759d8e4d8
3 changed files with 22 additions and 1 deletions

View file

@ -288,6 +288,15 @@ class LoggingTestCase(FlaskTestCase):
self.assert_equal(rv.status_code, 500)
self.assert_equal(rv.data, 'Hello Server Error')
def test_url_for_with_anchor(self):
app = flask.Flask(__name__)
@app.route('/')
def index():
return '42'
with app.test_request_context():
self.assert_equal(flask.url_for('index', _anchor='x y'),
'/#x%20y')
def suite():
suite = unittest.TestSuite()