diff --git a/test_queue_job/models/test_models.py b/test_queue_job/models/test_models.py index ca681a1181..d6d55381a5 100644 --- a/test_queue_job/models/test_models.py +++ b/test_queue_job/models/test_models.py @@ -90,6 +90,16 @@ def job_b(self): def job_sub_channel(self): return + @property + def dummy_property(self): + """ Return foo + + Only there to check that properties are compatible + with the automatic registration of job methods + and their default channels. + """ + return 'foo' + class TestRelatedAction(models.Model): diff --git a/test_queue_job/tests/test_job_channels.py b/test_queue_job/tests/test_job_channels.py index 3b9e385fc1..48b58e4656 100644 --- a/test_queue_job/tests/test_job_channels.py +++ b/test_queue_job/tests/test_job_channels.py @@ -40,9 +40,15 @@ def test_register_jobs(self): self.env['queue.job.channel'].search([('name', '!=', 'root')]).unlink() method_a = self.env['test.queue.channel'].job_a - self.env['queue.job.function']._register_job(method_a) + self.env['queue.job.function']._register_job( + self.env['test.queue.channel'], + method_a + ) method_b = self.env['test.queue.channel'].job_b - self.env['queue.job.function']._register_job(method_b) + self.env['queue.job.function']._register_job( + self.env['test.queue.channel'], + method_b + ) path_a = '.job_a' path_b = '.job_b' @@ -58,7 +64,10 @@ def test_channel_on_job(self): self.env['queue.job.channel'].search([('name', '!=', 'root')]).unlink() method = self.env['test.queue.channel'].job_a - self.env['queue.job.function']._register_job(method) + self.env['queue.job.function']._register_job( + self.env['test.queue.channel'], + method + ) path_a = '<%s>.%s' % (method.__self__.__class__._name, method.__name__) job_func = self.function_model.search([('name', '=', path_a)]) self.assertEquals(job_func.channel, 'root') @@ -91,7 +100,10 @@ def test_default_channel(self): self.env['queue.job.channel'].search([('name', '!=', 'root')]).unlink() method = self.env['test.queue.channel'].job_sub_channel - self.env['queue.job.function']._register_job(method) + self.env['queue.job.function']._register_job( + self.env['test.queue.channel'], + method + ) self.assertEquals(method.default_channel, 'root.sub.subsub') path_a = '<%s>.%s' % (method.__self__.__class__._name, method.__name__)