From ffe4acb667dfd78f28558d5eccbb38f7eabeec93 Mon Sep 17 00:00:00 2001 From: Dilan Coss Date: Tue, 29 May 2018 19:18:05 -0600 Subject: [PATCH] test_url_generation_with_parameter added --- tests/test_appctx.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_appctx.py b/tests/test_appctx.py index 251764cf..b2bbec48 100644 --- a/tests/test_appctx.py +++ b/tests/test_appctx.py @@ -26,6 +26,17 @@ def test_basic_url_generation(app): rv = flask.url_for('index') assert rv == 'https://localhost/' +def test_url_generation_with_parameter(app): + app.config['SERVER_NAME'] = 'localhost' + app.config['PREFERRED_URL_SCHEME'] = 'https' + + @app.route('/test/') + def test(): + pass + + with app.app_context(): + rv = flask.url_for('test', id=1) + assert rv == 'https://localhost/test/1' def test_url_generation_requires_server_name(app): with app.app_context():