Skip to content
Myr

Testing URL generation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent de03143 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:flask_tests.py+8 added
67 unmodified lines
68 c = app.test_client()69 assert c.post('/set', data={'value': '42'}).data == 'value set'70 assert c.get('/get').data == '42'7172 def test_url_generation(self):73 app = flask.Flask(__name__)74 @app.route('/hello/<name>', methods=['POST'])75 def hello():76 pass77 with app.test_request_context():78 assert flask.url_for('hello', name='test x') == '/hello/test%20x'798081if __name__ == '__main__':82 unittest.main()