logger.exception(f"Error rotating document {doc.id}: {e}")
if len(affected_docs) > 0:
- bulk_update_task = bulk_update_documents.s(document_ids=affected_docs)
+ bulk_update_task = bulk_update_documents.si(document_ids=affected_docs)
chord(header=rotate_tasks, body=bulk_update_task).delay()
return "OK"
mock_consume_file.assert_not_called()
- @mock.patch("documents.tasks.bulk_update_documents.s")
+ @mock.patch("documents.tasks.bulk_update_documents.si")
@mock.patch("documents.tasks.update_document_archive_file.s")
@mock.patch("celery.chord.delay")
def test_rotate(self, mock_chord, mock_update_document, mock_update_documents):
mock_chord.assert_called_once()
self.assertEqual(result, "OK")
- @mock.patch("documents.tasks.bulk_update_documents.s")
+ @mock.patch("documents.tasks.bulk_update_documents.si")
@mock.patch("documents.tasks.update_document_archive_file.s")
@mock.patch("pikepdf.Pdf.save")
def test_rotate_with_error(
self.assertIn(expected_str, error_str)
mock_update_archive_file.assert_not_called()
- @mock.patch("documents.tasks.bulk_update_documents.s")
+ @mock.patch("documents.tasks.bulk_update_documents.si")
@mock.patch("documents.tasks.update_document_archive_file.s")
@mock.patch("celery.chord.delay")
def test_rotate_non_pdf(