Skip to content

Commit

Permalink
Update test_auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Oct 9, 2024
1 parent 464d65d commit ceda267
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OpenOversight/tests/routes/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ceda267

Please sign in to comment.