1
0
Fork 0

Updates mocks in tests

This commit is contained in:
Mouse Reeve 2022-11-07 09:50:05 -08:00
parent 493fd68af4
commit 141d3aa813
8 changed files with 26 additions and 11 deletions

View file

@ -11,6 +11,7 @@ from bookwyrm import models, views
class ImportManualReviewViews(TestCase):
"""goodreads import views"""
# pylint: disable=invalid-name
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()
@ -59,7 +60,7 @@ class ImportManualReviewViews(TestCase):
request = self.factory.post("")
request.user = self.local_user
with patch("bookwyrm.importers.importer.import_item_task.delay") as mock:
with patch("bookwyrm.models.import_job.import_item_task.delay") as mock:
views.approve_import_item(request, self.job.id, import_item.id)
self.assertEqual(mock.call_count, 1)
import_item.refresh_from_db()

View file

@ -11,6 +11,7 @@ from bookwyrm import models, views
class ImportTroubleshootViews(TestCase):
"""goodreads import views"""
# pylint: disable=invalid-name
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()