chore: 整合 migration 文件并优化配置
- 整合 18 个分散的 migration 文件为 5 个模块化文件 - settings.py 支持 .env.local 覆盖 .env - 移除 user schema 中未使用的 country 字段正则 - 更新 profile protocol 文档移除 country 字段 - pyproject.toml 添加 ruff 到 dev 依赖 - 简化 integration test conftest 邮箱 fixture
This commit is contained in:
@@ -4,7 +4,6 @@ from collections.abc import AsyncIterator
|
||||
import hashlib
|
||||
import hmac
|
||||
import os
|
||||
import time
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
@@ -37,18 +36,13 @@ def test_verify_code() -> str:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def unique_test_email() -> str:
|
||||
base_email = os.environ.get("ERYAO_TEST__EMAIL", "test@example.com").strip().lower()
|
||||
if "@" in base_email:
|
||||
name, domain = base_email.split("@", 1)
|
||||
else:
|
||||
name, domain = base_email, "example.com"
|
||||
return f"{name}+it{int(time.time() * 1000)}@{domain}"
|
||||
def test_email() -> str:
|
||||
return os.environ.get("ERYAO_TEST__EMAIL", "test@example.com").strip().lower()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_identity(unique_test_email: str, test_verify_code: str) -> dict[str, str]:
|
||||
return {"email": unique_test_email, "code": test_verify_code}
|
||||
def test_identity(test_email: str, test_verify_code: str) -> dict[str, str]:
|
||||
return {"email": test_email, "code": test_verify_code}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user