Tuesday, April 29, 2025
1 change · master
Code cleanup and technical improvements
This refactor standardizes the test setup for Point of Sale-related modules by using shared products with simple prices and tax rates. It makes future testing easier and removes or merges duplicated backend tests where equivalent frontend coverage already exists, with no expected change for everyday users.
Original PR description
*: l10n_br_edi_pos, l10n_ke_edi_oscu_pos The aim of this commit is to make test writing easier, by choosing easy-to-calculate prices with their corresponding taxes. The products created have prices…
*: l10n_br_edi_pos, l10n_ke_edi_oscu_pos
The aim of this commit is to make test writing easier, by choosing
easy-to-calculate prices with their corresponding taxes.
The products created have prices of 10 or 20 with taxes of 5, 10 or 15
percent.
A global class will be created and inherited by all Point of Sale tests,
with the aim of always using products already available. If a different
product is required in a specific test, existing products can be
modified.
---
Test in file: `point_of_sale/tests/test_point_of_sale_flow.py`:
- Test `test_order_refund_lots` is removed and adapted in the frontend
tour `test_lot`
- Test `test_order_to_invoice` is removed because frontend is already
testing this behavior, related tests:
- Test `test_02_pos_with_invoiced`
- Test `test_order_and_invoice_amounts`
- And more in submodules...
- Test `test_order_with_deleted_tax` is removed because it is using
`sync_from_ui` method which should not be used in the backend.
Frontend tours are already testing its behavior
- Test `test_order_refund_picking` is merged with `test_order_to_picking`
- Test `test_order_with_different_payments_and_refund` is removed
because its description don't correspond to the actual behavior of the
test. The goal of the test isn't clear.
- Test `test_product_combo_creation` is removed because its already
tested in owner module.
- Test `test_order_refund_with_owner` was merged with the frontend
test `test_lot`
- Test `test_change_is_deducted_from_cash` was merged with the frontend
test `test_tracking_number_closing_session`