Files
FabledSteward/tests/test_models.py
T
bvandeusenandClaude Opus 5.5 2995cfdd68
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 1m7s
CI / unit (push) Failing after 1m24s
CI / publish (push) Skipped
fix(users): a password reset signs out every session begun with the old password (#5427)
#5427 "A password reset doesn't end the sessions already signed in with
the old password": users.sessions_since (migration 0038) is set on reset;
refresh_session_user ends a session whose login_at is earlier. An admin
resetting their own password carries on signed in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:25:35 -04:00

14 lines
521 B
Python

from steward.models.users import User, UserRole
def test_user_model_fields():
"""User model has all required fields."""
cols = {c.key for c in User.__table__.columns}
assert cols == {"id", "username", "email", "password_hash", "role", "created_at", "is_active",
"auth_source", "external_id", "time_zone", "notify_alerts", "notify_report",
"sessions_since"}
def test_user_role_enum():
assert set(UserRole) == {UserRole.admin, UserRole.operator, UserRole.viewer}