diff --git a/OpenOversight/tests/routes/test_auth.py b/OpenOversight/tests/routes/test_auth.py index 8596ae175..3d8c4d8f8 100644 --- a/OpenOversight/tests/routes/test_auth.py +++ b/OpenOversight/tests/routes/test_auth.py @@ -467,15 +467,15 @@ def test_disabled_user_cannot_visit_pages_requiring_auth(client, session): with current_app.test_request_context(): # Temporarily enable account for login user = User.query.filter_by(email=MOD_DISABLED_USER_EMAIL).one() - user.is_disabled = False + user.disabled_at = None + user.disabled_by = None session.add(user) rv, _ = login_modified_disabled_user(client) assert b"/user/sam" in rv.data # Disable account again and check that login_required redirects user correctly - user.is_disabled = True - session.add(user) + user.disable_user(User.query.filter_by(is_administrator=True).first().id) # Logged in disabled user cannot access pages requiring auth rv = client.get("/auth/logout")