修复:明确旧删除接口固定拒绝

This commit is contained in:
焦龙言
2026-09-22 19:00:38 +08:00
parent 46eff756de
commit 43fe17cc70
8 changed files with 42 additions and 12 deletions
@@ -1263,6 +1263,21 @@ class TestPalletAndAssignmentControllers(unittest.IsolatedAsyncioTestCase):
schema['paths']['/master/pallet/{pallet_id}/qrcode']['get']['responses']['200']['content'],
)
def test_legacy_delete_openapi_declares_fixed_rejection(self) -> None:
app = FastAPI()
for router in self._routers():
app.include_router(router)
operation = app.openapi()['paths']['/master/pallet/{pallet_ids}']['delete']
self.assertEqual('兼容旧接口,固定拒绝,请使用测试数据批次清理', operation['summary'])
self.assertEqual(
'兼容旧接口,固定拒绝单条物理删除,请使用测试数据批次清理',
operation['description'],
)
self.assertNotIn('用于删除', operation['description'])
self.assertNotIn('尚未入库', operation['description'])
self.assertNotIn('没有流转事件', operation['description'])
def test_route_response_models_are_exact(self) -> None:
routes = self._routes()
self.assertEqual(