paper-dynasty-database/tests
Cal Corum c0f862636a fix(render): schedule image_url backfill on cache hits
The card render endpoint's file-on-disk cache short-circuit returned
FileResponse immediately when the cached PNG existed, bypassing the
backfill BackgroundTask that populates battingcard.image_url /
pitchingcard.image_url. If a variant row was later recreated with
image_url=NULL while the PNG was still cached, the DB column stayed
NULL forever, breaking every downstream consumer that reads image_url for
display.

Extract the backfill-scheduling logic into a _schedule_variant_image_backfill
helper and call it on both the cache-hit and full-render paths. The
helper's internal guards (variant > 0, tier is None, row exists with
NULL image_url) keep the happy-path cache hit a no-op.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 10:12:23 -05:00
..
__init__.py feat: evolution track seed data and tests (WP-03) (#68) 2026-03-12 17:35:12 -05:00
conftest.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_card_storage.py fix: address review feedback (#187) 2026-04-06 20:03:02 -05:00
test_formula_engine.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_players_card_render.py fix(render): schedule image_url backfill on cache hits 2026-04-11 10:12:23 -05:00
test_postgame_refractor.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_refractor_boost_integration.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_refractor_boost.py fix: address PR #179 review — consolidate CSS, extract inline styles, add tests 2026-04-04 00:43:27 -05:00
test_refractor_evaluator.py feat: Refractor Phase 2 integration — wire boost into evaluate-game 2026-03-30 13:04:52 -05:00
test_refractor_image_url.py feat: include image_url in refractor cards API response 2026-04-06 22:36:20 +00:00
test_refractor_init.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_models.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_refractor_seed.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_state_api.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_refractor_track_api.py chore: remove unused RefractorTierBoost and RefractorCosmetic tables 2026-04-05 22:27:26 -05:00
test_season_stats_model.py refactor: deduplicate pitcher formula and test constants 2026-03-17 09:49:33 -05:00
test_season_stats_update.py fix: stale docstring + add decision-only pitcher test 2026-03-19 10:31:16 -05:00