test: lock that the deck list omits cards#58
Merged
Conversation
Port the regression test from litestar-sqlalchemy-template#33. The Deck response contract is two-shaped: light `Deck` for list/create/update, `DeckWithCards` for get_deck. No test asserted that `cards` is absent from list responses, so the contract wasn't pinned — the existing tests passed under both the old single-schema design and the split. test_list_decks_omits_cards creates a deck with a card, then asserts the list item has no `cards` key. It would catch a regression that re-added `cards` to the light contract. test_get_one_deck already locks the other half (detail includes cards). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Ports the regression test from litestar-sqlalchemy-template#33, adapted to this repo's
from fastapi import statusconvention.Why
The Deck response contract is deliberately two-shaped (per CLAUDE.md): light
schemas.Deckforlist_decks/create_deck/update_deck(nocards), andschemas.DeckWithCardsforget_deck. No test asserted thatcardsis absent from list responses, so that half of the contract wasn't pinned — existing tests would pass even ifcardsleaked back into the light schema.What
test_list_decks_omits_cardscreates a deck with a card, then asserts the list item has nocardskey. It would catch a regression that re-addedcardsto the light contract.test_get_one_deckalready locks the other half (detail includes cards).Full suite: 21 passed, 100% coverage. Lint +
tyclean.🤖 Generated with Claude Code