Fixes call to import task

This commit is contained in:
Mouse Reeve 2021-11-13 09:02:42 -08:00
parent 40fff02eec
commit 08f4ad6cd4
2 changed files with 3 additions and 3 deletions

View file

@ -101,9 +101,9 @@ class Importer:
self.create_item(job, item.index, item.data) self.create_item(job, item.index, item.data)
return job return job
def start_import(self, job): def start_import(self, job): # pylint: disable=no-self-use
"""initalizes a csv import job""" """initalizes a csv import job"""
result = start_import_task.delay(self.service, job.id) result = start_import_task.delay(job.id)
job.task_id = result.id job.task_id = result.id
job.save() job.save()

View file

@ -120,7 +120,7 @@ class GenericImporter(TestCase):
) )
with patch("bookwyrm.importers.importer.import_item_task.delay") as mock: with patch("bookwyrm.importers.importer.import_item_task.delay") as mock:
start_import_task(self.importer.service, import_job.id) start_import_task(import_job.id)
self.assertEqual(mock.call_count, 4) self.assertEqual(mock.call_count, 4)