♻️ Edit refactor db models to use UUID's instead of integer ID's (#1259)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Esteban Maya
2024-07-22 17:49:02 -05:00
committed by GitHub
parent cc480df776
commit e65b427ab1
9 changed files with 746 additions and 561 deletions

View File

@@ -1,3 +1,4 @@
import uuid
from unittest.mock import patch
from fastapi.testclient import TestClient
@@ -105,7 +106,7 @@ def test_get_existing_user_permissions_error(
client: TestClient, normal_user_token_headers: dict[str, str]
) -> None:
r = client.get(
f"{settings.API_V1_STR}/users/999999",
f"{settings.API_V1_STR}/users/{uuid.uuid4()}",
headers=normal_user_token_headers,
)
assert r.status_code == 403
@@ -371,7 +372,7 @@ def test_update_user_not_exists(
) -> None:
data = {"full_name": "Updated_full_name"}
r = client.patch(
f"{settings.API_V1_STR}/users/99999999",
f"{settings.API_V1_STR}/users/{uuid.uuid4()}",
headers=superuser_token_headers,
json=data,
)
@@ -468,7 +469,7 @@ def test_delete_user_not_found(
client: TestClient, superuser_token_headers: dict[str, str]
) -> None:
r = client.delete(
f"{settings.API_V1_STR}/users/99999999",
f"{settings.API_V1_STR}/users/{uuid.uuid4()}",
headers=superuser_token_headers,
)
assert r.status_code == 404