Cleanup: single source of truth for account roots; drop no-op per-test rate-limit reset #54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the high-effort code review of PR #46. Two minor cleanups.
1. The five account roots are encoded in three places.
static/js/index.jsaccountRootTypes()—['Assets','Liabilities','Equity','Income','Expenses']views_api.py:3661_VALID_ACCOUNT_PREFIXESaccount_utils.ACCOUNT_TYPE_ROOTSThe JS comment even says "Mirrors the server's
_VALID_ACCOUNT_PREFIXES" — an explicit drift hazard. If a root is ever renamed/added, all three must change in lockstep. Derive the JS list from a server-provided value (e.g. an existing settings/info endpoint) or at least centralize the Python copies into one constant.2. The per-test rate-limit reset is dead code.
tests/conftest.py_settings_cleanupsetslnbits_rate_limit_no = 1_000_000on every test, but the limiter is built once at app creation (the sessionsettingsfixture value is what matters). The per-test write does nothing — and would silently defeat any future test that deliberately lowers the limit to assert a 429. Drop it; keep only the session-fixture override.