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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user