feat: bootstrap dodo phase one

This commit is contained in:
2026-09-05 10:47:44 +08:00
commit f182c704a4
48 changed files with 4221 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import os
from pathlib import Path
import pytest
from fastapi.testclient import TestClient
@pytest.fixture
def client(tmp_path: Path):
os.environ["DODO_DATABASE_URL"] = f"sqlite+aiosqlite:///{tmp_path / 'test.db'}"
os.environ["DODO_AUTO_CREATE_SCHEMA"] = "true"
from backend.config import get_settings
get_settings.cache_clear()
from backend.db import reset_engine
reset_engine()
from backend.main import app
with TestClient(app) as test_client:
yield test_client
reset_engine()