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

Function test_multiple_cards

backend/tests/flashcards/card/test_api.py:48–67  ·  view source on GitHub ↗

Create testing cards

(
    client: TestClient,
    normal_user_token_headers: dict[str, str],
    test_collection: dict[str, Any],
)

Source from the content-addressed store, hash-verified

46
47@pytest.fixture
48def test_multiple_cards(
49 client: TestClient,
50 normal_user_token_headers: dict[str, str],
51 test_collection: dict[str, Any],
52) -> list[dict[str, Any]]:
53 """Create testing cards"""
54 collection_id = test_collection["id"]
55
56 cards = []
57 for i in range(5):
58 card_data = CardCreate(front=f"Test front {i}", back=f"Test back {i}")
59 rsp = client.post(
60 f"{settings.API_V1_STR}/collections/{collection_id}/cards/",
61 json=card_data.model_dump(),
62 headers=normal_user_token_headers,
63 )
64
65 assert rsp.status_code == 200
66 cards.append(rsp.json())
67 return cards
68
69
70def test_create_card_with_nonexistent_collection(

Callers

nothing calls this directly

Calls 1

CardCreateClass · 0.90

Tested by

no test coverage detected