Patches celery calls in connector tests

This commit is contained in:
Mouse Reeve 2021-01-02 09:08:37 -08:00
parent 86060f795d
commit 1e7aa283c2
2 changed files with 11 additions and 6 deletions

View file

@ -1,4 +1,5 @@
''' testing book data connectors '''
from unittest.mock import patch
from django.test import TestCase
import responses
@ -104,6 +105,8 @@ class AbstractConnector(TestCase):
'https://example.com/book/abcd',
json=self.edition_data
)
with patch(
'bookwyrm.connectors.abstract_connector.load_more_data.delay'):
result = self.connector.get_or_create_book(
'https://example.com/book/abcd')
self.assertEqual(result, self.book)

View file

@ -164,6 +164,8 @@ class ImportJob(TestCase):
json={'name': 'test author'},
status=200)
with patch(
'bookwyrm.connectors.abstract_connector.load_more_data.delay'):
with patch(
'bookwyrm.connectors.connector_manager.first_search_result'
) as search: