feat: Implement random password and token generation for tests

This commit is contained in:
2025-11-12 11:53:44 +01:00
parent 3bdae3c54c
commit e06a6ae068
8 changed files with 83 additions and 41 deletions

0
tests/utils/__init__.py Normal file
View File

13
tests/utils/security.py Normal file
View File

@@ -0,0 +1,13 @@
from __future__ import annotations
import secrets
def random_password() -> str:
"""Return a strong test password that satisfies complexity checks."""
return f"Aa1!{secrets.token_urlsafe(16)}"
def random_token() -> str:
"""Return a random token suitable for test session data."""
return secrets.token_urlsafe(24)