connect fix 4

This commit is contained in:
2026-08-21 06:14:10 +02:00
parent bf2a02679d
commit 5e506c9921
17 changed files with 1266 additions and 162 deletions

View File

@ -219,12 +219,18 @@ async def test_credentials_manage_role_grants_non_admin_write_access(client):
assert resp.status_code == 200, resp.text
assert resp.json()["rdp_credentials_set"] is False
resp = await client.put(f"/admin/hosts/{host_id}/rdp-credentials", json={"password": "s3hr-geheim!!"})
# Benutzername gehoert seit Migration 0010 zu den Zugangsdaten und ist
# beim Setzen Pflicht (siehe tests/test_phase12.py).
resp = await client.put(
f"/admin/hosts/{host_id}/rdp-credentials",
json={"password": "s3hr-geheim!!", "username": "Administrator"},
)
assert resp.status_code == 200, resp.text
resp = await client.get(f"/admin/hosts/{host_id}/credentials")
assert resp.status_code == 200, resp.text
assert resp.json()["rdp_credentials_set"] is True
assert resp.json()["rdp_credentials_username"] == "Administrator"
# Ein User OHNE diese Rolle bleibt weiterhin ausgesperrt.
client.cookies.clear()