Skip to content

Commit

Permalink
[MIG] test_queue_job: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
QuocDuong1306 authored and thienvh332 committed Oct 7, 2024
1 parent fe659d7 commit 630abaf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test_queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Queue Job Tests",
"version": "17.0.1.0.1",
"version": "18.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "LGPL-3",
"category": "Generic Modules",
Expand Down
6 changes: 3 additions & 3 deletions test_queue_job/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_test_queue_job,access_test_queue_job,model_test_queue_job,,1,1,1,1
access_test_queue_channel,access_test_queue_channel,model_test_queue_channel,,1,1,1,1
access_test_related_action,access_test_related_action,model_test_related_action,,1,1,1,1
access_test_queue_job,access_test_queue_job,model_test_queue_job,queue_job.group_queue_job_manager,1,1,1,1
access_test_queue_channel,access_test_queue_channel,model_test_queue_channel,queue_job.group_queue_job_manager,1,1,1,1
access_test_related_action,access_test_related_action,model_test_related_action,queue_job.group_queue_job_manager,1,1,1,1
2 changes: 1 addition & 1 deletion test_queue_job/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def setUpClass(cls):
def _create_job(self):
test_job = Job(self.method)
test_job.store()
stored = Job.db_record_from_uuid(self.env, test_job.uuid)
stored = Job.db_records_from_uuids(self.env, [test_job.uuid])
self.assertEqual(len(stored), 1)
return stored
5 changes: 3 additions & 2 deletions test_queue_job/tests/test_delay_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ def test_trap_jobs_on_with_delay_assert_model_enqueued_mismatch(self):
"identity_key=<function identity_exact at 0x[0-9a-fA-F]+>, "
"max_retries=1, priority=15\\) was not enqueued\\.\n"
"Actual enqueued jobs:\n"
r" \* <test.queue.job\({record_id},\)>.testing_method\(1, foo=2\) with "
rf" \* <test.queue.job\({recordset.id},\)>.testing_method\(1, foo=2\) "
r"with properties "
r"properties \(priority=15, max_retries=1, eta=15, description=Test, "
r"channel=root.test, "
r"identity_key=<function identity_exact at 0x[0-9a-fA-F]+>\)"
).format(record_id=recordset.id)
)
with self.assertRaisesRegex(AssertionError, message):
trap.assert_enqueued_job(
self.env["test.queue.job"].testing_method,
Expand Down
4 changes: 1 addition & 3 deletions test_queue_job/tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@ def test_button_done(self):
stored = self._create_job()
stored.button_done()
self.assertEqual(stored.state, DONE)
self.assertEqual(
stored.result, "Manually set to done by %s" % self.env.user.name
)
self.assertEqual(stored.result, f"Manually set to done by {self.env.user.name}")

def test_button_done_enqueue_waiting_dependencies(self):
job_root = Job(self.env["test.queue.job"].testing_method)
Expand Down
2 changes: 1 addition & 1 deletion test_queue_job/tests/test_job_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class TestJobFunction(common.TransactionCase):
def setUp(self):
super(TestJobFunction, self).setUp()
super().setUp()
self.test_function_model = self.env.ref(
"queue_job.job_function_queue_job__test_job"
)
Expand Down

0 comments on commit 630abaf

Please sign in to comment.