Skip to content

Commit 5038084

Browse files
[FIX] queue_job: Fix TestJson
In this case, when a module adds a value in context, the tests fail
1 parent b4ec9b2 commit 5038084

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

queue_job/tests/test_json_field.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ def test_encoder_recordset(self):
2222
value_json = json.dumps(value, cls=JobEncoder)
2323
expected_context = context.copy()
2424
expected_context.pop("uid")
25+
keys = partner._job_prepare_context_before_enqueue_keys()
26+
for key in expected_context.keys():
27+
if key not in keys:
28+
expected_context.pop(key, None)
2529
expected = {
2630
"uid": demo_user.id,
2731
"_type": "odoo_recordset",
@@ -40,6 +44,10 @@ def test_encoder_recordset_list(self):
4044
value_json = json.dumps(value, cls=JobEncoder)
4145
expected_context = context.copy()
4246
expected_context.pop("uid")
47+
keys = partner._job_prepare_context_before_enqueue_keys()
48+
for key in expected_context.keys():
49+
if key not in keys:
50+
expected_context.pop(key, None)
4351
expected = [
4452
"a",
4553
1,

0 commit comments

Comments
 (0)