Converts the ad-hoc scratch-script verification pattern used throughout this session's development (temp SQLite DB + create_app() + monkeypatched send_message/fiscalize_in_background/get_invoice_status, print-based check() assertions) into a real, repo-committed pytest suite under tests/. Covers: claim_order_paid() atomicity, cross-path payment race dedup (webhook/checkout-poll/reconciliation all observing the same paid invoice), fiscalization error alerting + cooldown, admin login brute-force lockout, the insecure-defaults startup check, supplier-import path-traversal protection, basic checkout smoke, and the supplier restock -> stock/supplier-link bug fixed earlier this session. Adds requirements-dev.txt (pytest only, keeping the existing monkeypatch-only style rather than a new mocking framework), pytest.ini so `pytest` runs from the repo root with no flags, and docs/TESTING.md covering how to run it and what's explicitly not covered yet (the React webapp, bot conversation flows beyond the checkout API, live Checkbox/Monobank/Google Drive integrations). 38 tests, all passing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 lines
66 B
INI
4 lines
66 B
INI
[pytest]
|
|
testpaths = tests
|
|
python_files = test_*.py
|
|
addopts = -ra
|