Patches celery calls in connector tests
This commit is contained in:
parent
86060f795d
commit
1e7aa283c2
|
@ -1,4 +1,5 @@
|
||||||
''' testing book data connectors '''
|
''' testing book data connectors '''
|
||||||
|
from unittest.mock import patch
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
import responses
|
import responses
|
||||||
|
|
||||||
|
@ -104,6 +105,8 @@ class AbstractConnector(TestCase):
|
||||||
'https://example.com/book/abcd',
|
'https://example.com/book/abcd',
|
||||||
json=self.edition_data
|
json=self.edition_data
|
||||||
)
|
)
|
||||||
|
with patch(
|
||||||
|
'bookwyrm.connectors.abstract_connector.load_more_data.delay'):
|
||||||
result = self.connector.get_or_create_book(
|
result = self.connector.get_or_create_book(
|
||||||
'https://example.com/book/abcd')
|
'https://example.com/book/abcd')
|
||||||
self.assertEqual(result, self.book)
|
self.assertEqual(result, self.book)
|
||||||
|
|
|
@ -164,6 +164,8 @@ class ImportJob(TestCase):
|
||||||
json={'name': 'test author'},
|
json={'name': 'test author'},
|
||||||
status=200)
|
status=200)
|
||||||
|
|
||||||
|
with patch(
|
||||||
|
'bookwyrm.connectors.abstract_connector.load_more_data.delay'):
|
||||||
with patch(
|
with patch(
|
||||||
'bookwyrm.connectors.connector_manager.first_search_result'
|
'bookwyrm.connectors.connector_manager.first_search_result'
|
||||||
) as search:
|
) as search:
|
||||||
|
|
Loading…
Reference in New Issue