From b55ab5ef5f547f63855090cea519703f960eff80 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Thu, 30 May 2024 20:18:51 +0000 Subject: [PATCH] fix(test): assertions for missing claim on AuthProvider were not correct the test was giving us a false positive because the verifier fixture is also not behaving correctly when returning `uses_auth_verification`. the test now fails, but the assertions are accurate based on what we have in `benefits.oauth.views.authorize` and `benefits.oauth.middleware`. --- tests/pytest/oauth/test_views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/pytest/oauth/test_views.py b/tests/pytest/oauth/test_views.py index 3c322ff71..f03ddb626 100644 --- a/tests/pytest/oauth/test_views.py +++ b/tests/pytest/oauth/test_views.py @@ -145,10 +145,9 @@ def test_authorize_success_without_verifier_claim( result = authorize(app_request) - mocked_oauth_client.authorize_access_token.assert_called_with(app_request) assert session.oauth_claim(app_request) is None - assert result.status_code == 302 - assert result.url == reverse(ROUTE_CONFIRM) + assert result.status_code == 200 + assert result.template_name == TEMPLATE_USER_ERROR @pytest.mark.django_db