Uh oh!
There was an error while loading. Please reload this page.
[18.0][FIX] queue_job: Fix TestJson - #909
Conversation
pedrobaeza
left a comment
There was a problem hiding this comment.
I don't think this is the proper fix, but to control the context in the tests for not having that one, but you may want to have all the context keys serialized for any usage of it.
Andrii9090-tecnativa
commented
Mar 2, 2026
@pedrobaeza How can this be done, by modifying the |
pedrobaeza
commented
Mar 2, 2026
Seeing the module, I think the final test line should be changed from: self.assertEqual(json.loads(value_json), expected)to: result_dict=json.loads(value_json)
forkeyinresult_dict:
self.assertEqual(result_dict[key], expected[key]) |
christian-ramos-tecnativa
commented
Mar 2, 2026
You could compare the jsons without the context and then loop through it as @pedrobaeza suggested |
5038084 to
d08d9b7CompareUh oh!
There was an error while loading. Please reload this page.
christian-ramos-tecnativa
left a comment
There was a problem hiding this comment.
I think is not fully solved as we should loop just for the context key
christian-ramos-tecnativa
left a comment
There was a problem hiding this comment.
I was able to solve it with this changes
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In this case, when a module adds a value in context, the tests fail
d08d9b7 to
27af421Compare
pedrobaeza
left a comment
There was a problem hiding this comment.
OK, let's make it resilient this way.
/ocabot merge patch
OCA-git-bot
commented
Mar 4, 2026
This PR looks fantastic, let's merge it! |
Uh oh!
There was an error while loading. Please reload this page.
OCA-git-bot
commented
Mar 4, 2026
Congratulations, your PR was merged at 1ea2c45. Thanks a lot for contributing to OCA. ❤️ |
When a module adds a value in context, the tests fail.
For example:
In this example, the
partner_external_mapmodule addedmap_website_id,route_map_website_id, androute_start_partner_idto the context, which caused the tests ofqueue_jobto fail.This fix ensures that only the keys returned by _job_prepare_context_before_enqueue_keys are preserved in the context, removing any additional values.
@pedrobaeza@christian-ramos-tecnativa could you review this PR?