[18.0][FIX] queue_job: Fix TestJson#909
Open
Andrii9090-tecnativa wants to merge 1 commit intoOCA:18.0from
Open
[18.0][FIX] queue_job: Fix TestJson#909Andrii9090-tecnativa wants to merge 1 commit intoOCA:18.0from
Andrii9090-tecnativa wants to merge 1 commit intoOCA:18.0from
Conversation
In this case, when a module adds a value in context, the tests fail
pedrobaeza
requested changes
Mar 2, 2026
Member
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.
Author
|
@pedrobaeza How can this be done, by modifying the |
Member
|
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)
for key in result_dict:
self.assertEqual(result_dict[key], expected[key]) |
|
You could compare the jsons without the context and then loop through it as @pedrobaeza suggested |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?