fixes book mock in user view tests

This commit is contained in:
Mouse Reeve 2021-08-05 17:47:28 -07:00
parent 70a535adb7
commit d390b395e6
2 changed files with 6 additions and 2 deletions

View file

@ -34,7 +34,9 @@ class EditUserViews(TestCase):
"rat@local.com", "rat@rat.rat", "password", local=True, localname="rat"
)
self.book = models.Edition.objects.create(title="test")
self.book = models.Edition.objects.create(
title="test", parent_work=models.Work.objects.create(title="test work")
)
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
models.ShelfBook.objects.create(
book=self.book,

View file

@ -28,7 +28,9 @@ class UserViews(TestCase):
self.rat = models.User.objects.create_user(
"rat@local.com", "rat@rat.rat", "password", local=True, localname="rat"
)
self.book = models.Edition.objects.create(title="test")
self.book = models.Edition.objects.create(
title="test", parent_work=models.Work.objects.create(title="test work")
)
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
models.ShelfBook.objects.create(