conftest e2e auth/test user create

This commit is contained in:
2026-08-17 19:33:23 +03:00
parent 0a4a21f2e7
commit 1eb9935a15
5 changed files with 61 additions and 21 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ from uuid import UUID
from pydantic import AfterValidator, BaseModel, EmailStr, Field
async def validate_password(password: str) -> str:
def validate_password(password: str) -> str:
PUNCTUATION: set[str] = {"$", "@", "#", "%", "!", "^", "&", "*", "(", ")", "-", "_", "+", "=", "{", "}", "[", "]"}
if len(password) < 8 or len(password) > 72:
raise ValueError("Password must be 8-72 characters")
+3 -1
View File
@@ -1,3 +1,5 @@
import asyncio
from src.database.users.crud import UsersCrudActions
from src.errors.http_errors.errors import Errors
from src.models.pydantic_models.model import UserCreate, UserOut, UserUpdate
@@ -15,7 +17,7 @@ class CrudService:
async def _plain_to_hash(self, user_data:dict)->dict:
user_data["hashed_password"]=user_data.pop("plain_password")
user_data["hashed_password"]=self.hash_service.plain_to_hash(user_data["hashed_password"])
user_data["hashed_password"]= await asyncio.to_thread(self.hash_service.plain_to_hash, user_data["hashed_password"])
return user_data