brand: remove all poona references and standardize on XYZ Hospital
This commit is contained in:
@@ -19,10 +19,10 @@ def _auth_headers(client, email: str) -> dict[str, str]:
|
||||
|
||||
|
||||
def test_global_search_grouped_and_department_scoped(client, db):
|
||||
bio_headers = _auth_headers(client, "bio@poona.demo")
|
||||
dept_headers = _auth_headers(client, "dept@poona.demo")
|
||||
bio_headers = _auth_headers(client, "bio@xyz.demo")
|
||||
dept_headers = _auth_headers(client, "dept@xyz.demo")
|
||||
|
||||
dept_user = db.query(User).filter(User.email == "dept@poona.demo").first()
|
||||
dept_user = db.query(User).filter(User.email == "dept@xyz.demo").first()
|
||||
icu_dept = db.query(Department).filter(Department.id == dept_user.department_id).first()
|
||||
assert dept_user is not None and icu_dept is not None
|
||||
|
||||
@@ -69,13 +69,13 @@ def test_global_search_grouped_and_department_scoped(client, db):
|
||||
|
||||
|
||||
def test_audit_logs_rbac_and_filters(client, db):
|
||||
admin_headers = _auth_headers(client, "admin@poona.demo")
|
||||
for email in ("bio@poona.demo", "mgmt@poona.demo", "dept@poona.demo", "coord@poona.demo"):
|
||||
admin_headers = _auth_headers(client, "admin@xyz.demo")
|
||||
for email in ("bio@xyz.demo", "mgmt@xyz.demo", "dept@xyz.demo", "coord@xyz.demo"):
|
||||
headers = _auth_headers(client, email)
|
||||
assert client.get("/api/audit-logs", headers=headers).status_code == 403
|
||||
|
||||
# Ensure there is at least one distinct AuditLog entry via API/DB
|
||||
admin_user = db.query(User).filter(User.email == "admin@poona.demo").first()
|
||||
admin_user = db.query(User).filter(User.email == "admin@xyz.demo").first()
|
||||
assert admin_user is not None
|
||||
log_entry = AuditLog(
|
||||
entity_type="asset",
|
||||
@@ -110,14 +110,14 @@ def test_login_rate_limiter_429_and_reset(client):
|
||||
for i in range(MAX_LOGIN_ATTEMPTS):
|
||||
res = client.post(
|
||||
"/api/auth/login",
|
||||
json={"email": "ratelimit@poona.demo", "password": "WrongPassword"},
|
||||
json={"email": "ratelimit@xyz.demo", "password": "WrongPassword"},
|
||||
)
|
||||
assert res.status_code == 401, f"Attempt {i + 1} unexpected status {res.status_code}"
|
||||
|
||||
# Attempt 16 triggers 429 RATE_LIMITED
|
||||
blocked = client.post(
|
||||
"/api/auth/login",
|
||||
json={"email": "ratelimit@poona.demo", "password": "WrongPassword"},
|
||||
json={"email": "ratelimit@xyz.demo", "password": "WrongPassword"},
|
||||
)
|
||||
assert blocked.status_code == 429
|
||||
assert blocked.json()["code"] == "RATE_LIMITED"
|
||||
@@ -126,7 +126,7 @@ def test_login_rate_limiter_429_and_reset(client):
|
||||
reset_login_rate_limiter()
|
||||
ok = client.post(
|
||||
"/api/auth/login",
|
||||
json={"email": "admin@poona.demo", "password": "Demo@123"},
|
||||
json={"email": "admin@xyz.demo", "password": "Demo@123"},
|
||||
)
|
||||
assert ok.status_code == 200
|
||||
|
||||
|
||||
Reference in New Issue
Block a user