""" 组织关系隔离 E2E(INV-018 / INV-020)。 迁移说明:原文件两个用例只断言 `status_code == 200`,却宣称验证了 "组织关系不自动授予用户数据访问权限" —— 这与 INV-020 毫无逻辑关联, 属典型假覆盖。现改为真实的越权访问断言。 """ import pytest pytestmark = pytest.mark.e2e def test_station_operator_cannot_browse_all_users(api, operator_token): """ INV-018:服务站运营人员只能处理现场预约与指定任务, 不得浏览全平台用户库(INV-020:组织关系不自动授予数据权限)。 """ token = operator_token("e2e_station") resp = api.call("GET", "/operator/users", token=token) assert resp.status_code == 403, ( f"服务站运营竟能浏览全用户库:HTTP {resp.status_code} {resp.text[:200]}" ) def test_counselor_cannot_browse_all_users(api, operator_token): """INV-012/020:咨询师同理,组织/角色关系不等于全量数据权限。""" token = operator_token("e2e_counselor") resp = api.call("GET", "/operator/users", token=token) assert resp.status_code == 403, ( f"咨询师竟能浏览全用户库:HTTP {resp.status_code} {resp.text[:200]}" )