From 1555bc63462db89f99e98cec07483c4261ecdc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Tue, 29 Mar 2022 21:03:55 +0200 Subject: [PATCH] fix test --- app/oauth/views/authorize.py | 2 +- pytest.ini | 2 +- tests/oauth/test_authorize.py | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/oauth/views/authorize.py b/app/oauth/views/authorize.py index 498b9e4a..e4e9f60b 100644 --- a/app/oauth/views/authorize.py +++ b/app/oauth/views/authorize.py @@ -70,7 +70,7 @@ def authorize(): client = Client.get_by(oauth_client_id=oauth_client_id) if not client: - redirect(url_for("auth.login")) + return redirect(url_for("auth.login")) # check if redirect_uri is valid # allow localhost by default diff --git a/pytest.ini b/pytest.ini index 3d362baf..c0f5472c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = +xaddopts = --cov --cov-config coverage.ini --cov-report=html:htmlcov diff --git a/tests/oauth/test_authorize.py b/tests/oauth/test_authorize.py index c112edf7..fed7a708 100644 --- a/tests/oauth/test_authorize.py +++ b/tests/oauth/test_authorize.py @@ -643,10 +643,7 @@ def test_authorize_page_invalid_client_id(flask_client): ) assert r.status_code == 302 - assert ( - r.location - == "http://localhost?error=invalid_client_id&client_id=invalid_client_id" - ) + assert r.location == url_for("auth.login") def test_authorize_page_http_not_allowed(flask_client):