1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

миграции3322

This commit is contained in:
MoonTestUse1
2025-01-04 04:05:36 +06:00
parent f660d5e755
commit 624064825b

View File

@@ -34,7 +34,6 @@ def test_login_success(test_db: Session):
assert response.json()["token_type"] == "bearer" assert response.json()["token_type"] == "bearer"
def test_login_wrong_password(test_db: Session): def test_login_wrong_password(test_db: Session):
# Создаем тестового сотрудника с известным паролем
hashed_password = get_password_hash("testpass123") hashed_password = get_password_hash("testpass123")
employee = employees.create_employee( employee = employees.create_employee(
test_db, test_db,
@@ -49,12 +48,9 @@ def test_login_wrong_password(test_db: Session):
response = client.post( response = client.post(
"/api/auth/login", "/api/auth/login",
data={ data={"username": "WrongPass",
"username": "WrongPass", "password": "wrongpass"}
"password": "wrongpass"
}
) )
assert response.status_code == 401 assert response.status_code == 401
assert "detail" in response.json() assert "detail" in response.json()