Raykov-MS 3d134fb7f9 srez
2026-05-08 13:16:31 +03:00

22 lines
563 B
Python

import pytest
from fastapi.testclient import TestClient
from src.main import app
@pytest.fixture
def client():
# Используем настройки и DATABASE_URL из окружения так же, как это делает приложение.
with TestClient(app) as test_client:
yield test_client
@pytest.fixture
def admin_tokens(client):
response = client.post(
"/api/v1/auth/login",
json={"username": "admin", "password": "admin123"},
)
assert response.status_code == 200
return response.json()