addons-cm/website_sale_aplicoop/tests
GitHub Copilot 3e4bd5e5db [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code
The dead-code cleanup dropped 11 test files that were never wired into
tests/__init__.py. Reviewing what they covered turned up real holes, so the
worthwhile ones come back, rewritten against the current schema.

Blacklists were the serious gap: product, supplier and category exclusions
have absolute priority over product discovery and nothing exercised them.
The old file had two separate defects. Its supplier fixtures wrote
`main_seller_id` directly, but product_main_seller computes that field from
`variant_seller_ids`, so the compute reset it to False and the blacklist had
nothing to exclude; they now create real supplierinfo records. Worse, four
whole classes asserted against `group_order.product_ids` -- the m2m *input* --
instead of the discovery result, so they set `category_ids` and then checked a
field they never touched. Those go through `_get_products_for_group_order`
now, and three tests that had no assertions at all got some.

The remaining three failures were test bugs too, all Odoo 17->18 leftovers:

* Date cases assumed `pickup_date` derives from `start_date`. The chain is
  cutoff -> pickup -> delivery, and a recurring order whose start date has
  passed rolls forward to the current cycle, so a 2024 order has no 2024
  pickup. The new file anchors on future dates and finds the next 29 February
  dynamically, with a class documenting the roll-forward itself.
* `/eskaera/labels` is `type="json"`; the old test hit it with a plain GET and
  read the resulting 400 as a bug. It is called over JSON-RPC now, and a test
  pins the 400 so nobody repeats it. Also `uom.uom.categ` -> `uom.category`.
* `price_include` is computed in 18.0, so fixtures must set
  `price_include_override`. On top of that `_get_price` filters taxes by
  company and defaults to `env.company`, not the fixture's, which left the
  tax list empty -- `tax_included` was False for the wrong reason.

Two of the portal tests were passing for the wrong reason as well: the access
guard bounced them to /eskaera, which also answers 200. Membership has to be
set from the member side with `is_group`, and a new test checks the final URL
rather than the status alone. Each fixture that can silently build the wrong
thing now carries a guard test.

Left out on purpose: three files were unimplemented placeholders, and
test_draft_persistence still deserves recovering (see the notes file).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 17:24:31 +02:00
..
__init__.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
COBERTURA_TESTS_ANALISIS.md [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
PHASE3_TEST_SUMMARY.md [DOC] website_sale_aplicoop: Add lazy loading documentation and implement v18.0.1.3.0 feature 2026-02-16 18:39:39 +01:00
test_cron_picking_batch.py [IMP] website_sale_aplicoop: automate non-weekly group order cycles 2026-07-15 16:26:14 +02:00
test_date_calculations.py [FIX] website_sale_aplicoop: harden group order cron 2026-03-31 19:36:20 +02:00
test_date_edge_cases.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_eskaera_shop.py [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
test_forecasted_stock.py [IMP] website_sale_aplicoop: filter and cap stock using forecasted net qty 2026-06-12 18:18:40 +02:00
test_group_order.py [REF] Code quality improvements and structure fixes 2026-02-21 13:51:25 +01:00
test_group_order_slug.py [FIX] website_sale_aplicoop: three defects in the group order slug 2026-08-11 22:53:09 +02:00
test_group_order_status_endpoint.py [FIX] website_sale_aplicoop: scope draft lookup to active cycle window 2026-05-29 17:40:48 +02:00
test_home_delivery.py [TEST] website_sale_aplicoop: add tests for home_delivery computed field 2026-05-20 17:49:50 +02:00
test_multi_company.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
test_online_payment.py [ADD] website_sale_aplicoop: online payment per group order 2026-08-16 21:59:35 +02:00
test_phase3_confirm_eskaera.py [TEST] website_sale_aplicoop: add tests for home_delivery computed field 2026-05-20 17:49:50 +02:00
test_portal_routes.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_portal_sale_order_creation.py feat(website_sale_aplicoop): ordenar productos por website_sequence y nombre 2026-02-25 19:34:49 +01:00
test_price_with_taxes_included.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_pricing_with_pricelist.py [FIX] website_sale_aplicoop: align pricing and drafts 2026-02-27 19:39:25 +01:00
test_product_discovery.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_product_extension.py [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
test_record_rules.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
test_res_partner.py [IMP] website_sale_aplicoop: propagate consumer_group_id directly from group_order 2026-03-06 13:49:13 +01:00
test_save_order_endpoints.py [TEST] website_sale_aplicoop: add tests for home_delivery computed field 2026-05-20 17:49:50 +02:00
test_templates_rendering.py [FIX] Resolver 3 fallos de tests en website_sale_aplicoop 2026-03-30 16:21:57 +02:00