Add comprehensive unit tests: 55% → 100% coverage - #4
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add comprehensive unit tests: 55% → 100% coverage#4devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- test_api.py: all FastAPI endpoints (health, boxes, orders, partners, redeem, admin, lifespan, local_only, race condition) - test_qr.py: QR SVG generation - test_seed.py: demo data seeding and idempotency - test_db_extra.py: Store methods (partners, filters, orders list, refund edges, reset, count, stats branches) - test_models.py: computed fields (discount, category_ru, emoji) and edge cases 69 tests total, all passing. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
wpalish
pushed a commit
that referenced
this pull request
Jul 16, 2026
…арточка); +контраст футера По UX-ревью: - #1 localStorage-нотис был плавающей центр-карточкой (читалось как «глюк» поверх секций) → тонкая полоса во всю ширину, приклеена к низу (над bottom-nav на мобиле, к краю на десктопе). Показ один раз (флаг ym_cookies уже был). - #6 контраст копирайта/FAQ-текста в футере поднят (.6→.78, .7→.82 opacity) — запас под WCAG AA. Уже было в коде: #4 срочность («🔥 осталось N» + окно выдачи), #7 соцсети на светлом --on-ink (не бледные). Требуют ассетов (отдельно): #2 превью карты, #3 логотипы партнёров/отзывы, #5 лого-марка, #8 PWA-бейджи. Co-Authored-By: Claude Sonnet 5 <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.
Summary
Raises test coverage from 55% (7 tests) to 100% (69 tests) by adding unit tests for every previously uncovered module.
Before → After
app/main.pyapp/qr.pyapp/seed.pyapp/db.pyapp/models.pyNew test files
tests/test_api.py— 29 tests covering all FastAPI endpoints viaTestClient: CRUD for boxes/orders,GET /districts,POST /redeem, admin stats/refund/seed, plus thelifespanauto-seed path,local_only403 rejection, andcreate_orderrace-condition 409.tests/test_db_extra.py— 19 tests forStoremethods not exercised bytest_flow.py:partners(),boxes_available(district=…)filtering,partner_boxes(),orders(),partner_orders(),order_by_code()miss,_effective_statuswith invalid date,refundof issued/nonexistent orders,reset(),count(),statsno-show/active branches.tests/test_models.py— 7 tests forBox/Ordercomputed fields (discount,category_ru,emoji) and edge cases (value_est=0,_utcnowawareness).tests/test_qr.py— 3 tests: SVG output correctness, no newlines,scaleparameter effect.tests/test_seed.py— 4 tests: partner/box counts, availability, idempotency across double-seed.All tests use
tmp_pathfixtures for DB isolation; API tests patch the globalstoreto avoid side effects.Link to Devin session: https://app.devin.ai/sessions/483840f3650040e49f52a49056a6800a
Requested by: @wpalish