fix: repair login endpoint registration in auth router

This commit is contained in:
2026-04-19 17:20:11 +03:00
parent 7ff9a705cd
commit d9ead1aafd
6 changed files with 272 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ class TestUserAuthentication:
}
with patch("backend.routers.auth.get_ldap_config", return_value=ldap_config):
response = test_client.post(
"/auth/login",
"/users/login",
json={"username": "testuser", "password": "password123"}
)
assert response.status_code == status.HTTP_200_OK
@@ -46,7 +46,7 @@ class TestUserAuthentication:
patch("backend.routers.auth.ldap3.Server"), \
patch("backend.routers.auth.ldap3.Connection", side_effect=Exception("Invalid credentials")):
response = test_client.post(
"/auth/login",
"/users/login",
json={"username": "testuser", "password": "wrongpassword"}
)
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@@ -67,7 +67,7 @@ class TestUserAuthentication:
test_db.commit()
response = test_client.post(
"/auth/login",
"/users/login",
json={"username": "localuser", "password": "password123"}
)
assert response.status_code == status.HTTP_200_OK