MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / test_different_user_delete

Function test_different_user_delete

backend/tests/flashcards/card/test_api.py:327–348  ·  view source on GitHub ↗
(
    client: TestClient,
    normal_user_token_headers: dict[str, str],
    superuser_token_headers: dict[str, str],
    test_collection: dict[str, Any],
    test_card: dict[str, Any],
)

Source from the content-addressed store, hash-verified

325
326
327def test_different_user_delete(
328 client: TestClient,
329 normal_user_token_headers: dict[str, str],
330 superuser_token_headers: dict[str, str],
331 test_collection: dict[str, Any],
332 test_card: dict[str, Any],
333):
334 collection_id = test_collection["id"]
335 card_id = test_card["id"]
336 rsp = client.delete(
337 f"{settings.API_V1_STR}/collections/{collection_id}/cards/{card_id}",
338 headers=superuser_token_headers,
339 )
340
341 assert rsp.status_code == 404
342
343 # Verity the data still exists
344 verify_rsp = client.get(
345 f"{settings.API_V1_STR}/collections/{collection_id}/cards/{card_id}",
346 headers=normal_user_token_headers,
347 )
348 assert verify_rsp.status_code == 200
349
350
351def test_deleted_card_not_in_list(

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected