- FastAPI + SQLAlchemy async + Alembic + Postgres backend - Auth: JWT access + rotating refresh tokens, argon2, roles, audit log - React 19 + Vite frontend: login page, protected route, auth context - Docker Compose: postgres, redis, migrate, api, worker (placeholder), frontend/nginx Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
19 lines
698 B
Python
19 lines
698 B
Python
"""Общая настройка тестов.
|
|
|
|
Переменные окружения проставляются до импорта `app.core.config`, иначе
|
|
Settings прочитает рабочий .env (или упадёт на его отсутствии).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from cryptography.fernet import Fernet
|
|
|
|
os.environ.setdefault("ENVIRONMENT", "local")
|
|
os.environ.setdefault("SECRET_KEY", "test-secret-key-not-for-production")
|
|
os.environ.setdefault("ENCRYPTION_KEY", Fernet.generate_key().decode())
|
|
os.environ.setdefault("POSTGRES_HOST", "localhost")
|
|
os.environ.setdefault("POSTGRES_PASSWORD", "test")
|
|
os.environ.setdefault("CORS_ORIGINS", "")
|