Commit Graph
2 Commits
Author SHA1 Message Date
ClaudeandClaude 25c8b039ac test(integration): 补 commit/rollback 与 operation_log 集成测试
- test_write_commit_persists:成功写操作被 db_session_middleware 提交
- test_write_rollback_on_validation_error:参数校验失败回滚,无脏数据
- test_operation_log_persists_on_success/failure:operation_log 独立会话落库,业务失败也记录
- 集成测试共 7 项,全部通过

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 11:29:22 +08:00
ClaudeandClaude 13853daa4a feat(phase6): 测试补全 + 集成测试 + repository 落地示范
- tests/unit/modules/test_repository.py:base_repository 在 SQLite 内存库的 CRUD 测试
- tests/integration/api/test_smoke.py:登录链路 / 只读接口 / 未授权拦截(标记 integration,默认跳过)
- conftest 提供 sqlite_db(隔离 DB)与 app/client/admin_headers(集成)fixture
- pytest.ini 默认跳过 integration,Makefile test-integration 可显式运行
- 修复 base_repository.get_by_id/get_by_ids 对字符串 ID 的兼容(URL 路径参数)
- 示范 modules/system/level service 改用 level_repo,CRUD 全链路实测通过

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 10:21:41 +08:00