Files
Samir Boulahtit b65c51c038
All checks were successful
CI / ruff (push) Successful in 18s
CI / pytest (push) Successful in 2h27m38s
CI / dependency-scanning (push) Successful in 32s
CI / docs (push) Successful in 50s
CI / validate (push) Successful in 31s
CI / deploy (push) Successful in 3m44s
test: realign deps + page_context tests with current source
Two stale unit-test groups left over from earlier intentional changes:

1. tests/unit/api/test_deps.py — TestGetCurrentStoreApi
   get_current_store_api gained a leading `request: Request` param in
   commit 6276e9e3 (terminal-device pairing) so the device-token path
   could record last_seen IP. The three tests still passed `(creds, db)`
   positionally, so `creds` bound to `request` and the function blew up
   with `Session has no attribute 'credentials'`. Pass a mock request
   first using the existing `_make_request` helper.

2. tests/unit/utils/test_page_context.py — TestBaseUrlCalculation
   d591200d switched the storefront base_url builder to use
   `store.subdomain or store.store_code` (lowercase slug) because the
   store-context middleware resolves URLs by the lowercase slug; the
   uppercase `store_code` is for internal use. Tests still asserted the
   old uppercase shape. Update the two URL assertions to the lowercase
   subdomain, invert `test_base_url_uses_store_code_not_subdomain` into
   `test_base_url_uses_subdomain_not_store_code`, and add a fallback
   test that exercises the `or store.store_code` path when subdomain
   is None.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 22:58:07 +02:00
..