Skip to content

Commit

Permalink
Debug travis
Browse files Browse the repository at this point in the history
  • Loading branch information
lmignon committed Mar 30, 2017
1 parent 8a291da commit 45d0019
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions queue_job/job.py
Expand Up @@ -208,9 +208,6 @@ def load(cls, env, job_uuid):
if stored.eta:
eta = dt_from_string(stored.eta)

if not stored.channel:
# travis debug
raise Exception('Channel not found')
job_ = cls(method, args=args, kwargs=kwargs,
priority=stored.priority, eta=eta, job_uuid=stored.uuid,
description=stored.name, channel=stored.channel)
Expand Down
6 changes: 2 additions & 4 deletions queue_job/models/queue_job.py
Expand Up @@ -78,9 +78,8 @@ class QueueJob(models.Model):
readonly=True,
store=True)

channel = fields.Char( compute='_compute_job_function',
# travis debug
#inverse='_inverse_channel',
channel = fields.Char(compute='_compute_channel',
inverse='_inverse_channel',
store=True,
index=True)

Expand All @@ -105,7 +104,6 @@ def _compute_job_function(self):
function = func_model.search([('name', '=', channel_method_name)])
record.channel_method_name = channel_method_name
record.job_function_id = function
record.channel = record.job_function_id.channel

@api.multi
@api.depends('model_name', 'method_name', 'record_ids', 'args', 'kwargs')
Expand Down
1 change: 0 additions & 1 deletion test_queue_job/tests/test_job.py
Expand Up @@ -205,7 +205,6 @@ def test_read(self):
self.assertEqual(test_job.result, job_read.result)
self.assertEqual(test_job.user_id, job_read.user_id)
self.assertEqual(test_job.company_id, job_read.company_id)
self.assertEqual('root', job_read.channel)
delta = timedelta(seconds=1) # DB does not keep milliseconds
self.assertAlmostEqual(test_job.date_created, job_read.date_created,
delta=delta)
Expand Down
2 changes: 2 additions & 0 deletions test_queue_job/tests/test_job_channels.py
Expand Up @@ -68,6 +68,8 @@ def test_channel_on_job(self):
test_job.store()
stored = self.env['queue.job'].search([('uuid', '=', test_job.uuid)])
self.assertEquals(stored.channel, 'root')
job_read = Job.load(self.env, test_job.uuid)
self.assertEquals(job_read.channel, 'root')

channel = self.channel_model.create(
{'name': 'sub', 'parent_id': self.root_channel.id}
Expand Down

0 comments on commit 45d0019

Please sign in to comment.