-
-
Notifications
You must be signed in to change notification settings - Fork 594
Description
Is your feature request related to a problem?
Recently, the v16.0 ver. of the queue_job module was updated, to filter out context values down to a smaller selection of keys
-> OCA/queue#743 , backported to v16 through OCA/queue#794
This poses an issue for modules both inheriting from contract_payment_auto and contract_queue_job, which use the test_target_state context value used in tests related to the former module, since the later module filters out that context value when using recurring_create_invoice, failing tests.
Describe the solution you'd like
For our custom module inheriting from both of these modules, we added a base model inheritance in the tests directory, in which we add test_target_state to the context keys passed to the job, which we then load in the model registry in the actual tests
-> commown/commown-odoo-addons#538
This could however be a standalone module (for instance named test_contract_payment_auto_job_target_state_ctx_val - might be too long LOL), from which test modules could inherit if they introduce features using both contract_payment_auto and contract_queue_job.
We might start dev on this module, to also add a test to check that the context is indeed passed to the job, when we get the time.
Alternatives considered
Another possibility would be to change queue_job's implementation of the context key filtering, to also allow all keys starting with test_<...>, to avoid filtering out test context values and rendering many tests using jobs inusable, even outside of the context of contract_payment_auto - ie. test_tax_required from account-invoicing/account_invoice_tax_required