fix(mcp): status active + search_products guard + item.product + cleanup auto-name

This commit is contained in:
2026-05-28 06:41:04 +02:00
parent 87efbcb03d
commit 5d7dbec67c
2 changed files with 27 additions and 18 deletions
+8
View File
@@ -1,4 +1,5 @@
import json
import uuid
import pytest
from sqlalchemy import delete
import app.api.mcp_server as mcp_server_module
@@ -155,7 +156,14 @@ async def test_create_shopping_list_outil():
async def test_create_shopping_list_nom_auto():
result = await create_shopping_list()
data = json.loads(result)
# Le nom auto est au format "S{semaine} {année}" (ex: "S22 2026")
assert data["name"].startswith("S")
# Cleanup manuel — la liste auto n'a pas le préfixe TEST_MCP_
async with mcp_server_module.AsyncSessionLocal() as session:
await session.execute(
delete(ShoppingList).where(ShoppingList.id == uuid.UUID(data["id"]))
)
await session.commit()
async def test_add_shopping_item_outil():