Fix calling convention for celery options

This commit is contained in:
J. Cliff Dyer
2017-04-25 16:57:35 -04:00
parent 0df079a9c6
commit 8e409800fe
2 changed files with 5 additions and 8 deletions

View File

@@ -106,10 +106,7 @@ class Command(BaseCommand):
'batch_size': batch_size,
'estimate_first_attempted': options['estimate_first_attempted']
}
result = tasks.compute_grades_for_course_v2.apply_async(
kwargs=kwargs,
options=task_options,
)
result = tasks.compute_grades_for_course_v2.apply_async(kwargs=kwargs, **task_options)
log.info("Grades: Created {task_name}[{task_id}] with arguments {kwargs}".format(
task_name=tasks.compute_grades_for_course.name,
task_id=result.task_id,

View File

@@ -101,19 +101,19 @@ class TestComputeGrades(SharedModuleStoreTestCase):
mock_task.apply_async.call_args_list,
[
({
'options': {'routing_key': 'key'},
'routing_key': 'key',
'kwargs': _kwargs(self.course_keys[0], 0)
},),
({
'options': {'routing_key': 'key'},
'routing_key': 'key',
'kwargs': _kwargs(self.course_keys[0], 2)
},),
({
'options': {'routing_key': 'key'},
'routing_key': 'key',
'kwargs': _kwargs(self.course_keys[3], 0)
},),
({
'options': {'routing_key': 'key'},
'routing_key': 'key',
'kwargs': _kwargs(self.course_keys[3], 2)
},),
],