feat: 添加异常日志功能并优化UI样式
refactor: 重构后端查询逻辑和API响应处理 fix: 修复用户角色更新和文件上传问题 test: 添加前端性能测试脚本和E2E测试用例 chore: 更新依赖版本和配置文件 docs: 添加环境检查脚本和测试文档 style: 统一表格标签样式和路由命名 perf: 优化前端页面加载速度和响应时间
This commit is contained in:
@@ -15,9 +15,11 @@ from utils.test_data_manager import TestDataManager
|
||||
@pytest.fixture(scope="session")
|
||||
def event_loop():
|
||||
"""创建事件循环"""
|
||||
loop = asyncio.get_event_loop_policy().new_event_loop()
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
yield loop
|
||||
loop.close()
|
||||
asyncio.set_event_loop(None)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -62,6 +64,8 @@ async def http_client() -> AsyncGenerator[AsyncClient, None]:
|
||||
@pytest.fixture
|
||||
async def auth_token(http_client: AsyncClient) -> str:
|
||||
"""获取认证token"""
|
||||
from config.settings import settings
|
||||
print(f"测试登录配置: username={settings.TEST_USERNAME}, password={settings.TEST_PASSWORD}")
|
||||
response = await http_client.post(
|
||||
"/api/auth/login",
|
||||
json={
|
||||
@@ -69,6 +73,9 @@ async def auth_token(http_client: AsyncClient) -> str:
|
||||
"password": settings.TEST_PASSWORD
|
||||
}
|
||||
)
|
||||
print(f"登录响应状态: {response.status_code}")
|
||||
if response.status_code != 200:
|
||||
print(f"登录响应内容: {response.text}")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
return data.get("token")
|
||||
|
||||
Reference in New Issue
Block a user