From 040f4b4f9f38af448e377995353ba7b375798cbf Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 14 Nov 2023 08:38:11 -0800 Subject: [PATCH] fix tests --- tests/app/main/views/test_sign_out.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/app/main/views/test_sign_out.py b/tests/app/main/views/test_sign_out.py index ad63b0556..9ab3ad3cc 100644 --- a/tests/app/main/views/test_sign_out.py +++ b/tests/app/main/views/test_sign_out.py @@ -1,16 +1,17 @@ -from flask import url_for - from tests.conftest import SERVICE_ONE_ID def test_render_sign_out_redirects_to_sign_in(client_request): + # TODO with the change to using login.gov, we no longer redirect directly to the sign in page. + # Instead we redirect to login.gov which redirects us to the sign in page. However, the + # test for the expected redirect being "/" is buried in conftest and looks fragile. + # After we move to login.gov officially and get rid of other forms of signing it, it should + # be refactored. with client_request.session_transaction() as session: assert session client_request.get( "main.sign_out", - _expected_redirect=url_for( - "main.index", - ), + _expected_status=302, ) with client_request.session_transaction() as session: assert not session @@ -42,9 +43,6 @@ def test_sign_out_user( client_request.get( "main.sign_out", _expected_status=302, - _expected_redirect=url_for( - "main.index", - ), ) with client_request.session_transaction() as session: assert session.get("user_id") is None