Spaces:
Sleeping
Sleeping
Commit ·
cb8f934
1
Parent(s): e94c8b7
test: fix role assertions for per-project authorization
Browse files- Update test_admin_role_takes_precedence to check per-project roles
- Tests now verify admin roles are assigned per-project, not globally
- All 120 tests passing
tests/unit/test_auth_service.py
CHANGED
|
@@ -69,7 +69,13 @@ class TestAuthService:
|
|
| 69 |
session = auth_service.login("admin_user")
|
| 70 |
|
| 71 |
assert session is not None
|
| 72 |
-
assert session.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
def test_session_expiration(self, auth_service, setup_users):
|
| 75 |
"""Test that expired sessions are handled."""
|
|
|
|
| 69 |
session = auth_service.login("admin_user")
|
| 70 |
|
| 71 |
assert session is not None
|
| 72 |
+
assert session.username == "admin_user"
|
| 73 |
+
# No global role anymore; check per-project role instead
|
| 74 |
+
admin_projects = [
|
| 75 |
+
proj for proj in session.authorized_projects
|
| 76 |
+
if auth_service.get_user_role_for_project("admin_user", proj) == Role.admin
|
| 77 |
+
]
|
| 78 |
+
assert len(admin_projects) >= 1 # admin_user has at least 1 admin project
|
| 79 |
|
| 80 |
def test_session_expiration(self, auth_service, setup_users):
|
| 81 |
"""Test that expired sessions are handled."""
|