recetas B3: DELETE /cookbook/{author_id} (opt-out del respaldo, borra solo privadas)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Carlos Narro
2026-07-03 08:22:40 +02:00
parent 0844287043
commit 9157d12f67
2 changed files with 24 additions and 0 deletions

View File

@@ -47,3 +47,14 @@ def test_receta_anonima_sin_nombre():
"items": [], "visibility": "public", "authorId": "a2"})
got = client.get("/recipes/anon").json()
assert got["authorName"] is None
def test_delete_cookbook_borra_solo_privadas():
client.post("/recipes", json={"id": "d_pub", "name": "P", "servings": 1,
"items": [], "visibility": "public", "authorId": "del"})
client.post("/recipes", json={"id": "d_prv", "name": "Q", "servings": 1,
"items": [], "visibility": "private", "authorId": "del"})
res = client.request("DELETE", "/cookbook/del").json()
assert res["deleted"] == 1
ids = {x["id"] for x in client.get("/cookbook/del").json()}
assert ids == {"d_pub"} # la pública se mantiene