Fixes redis interaction mock

This commit is contained in:
Mouse Reeve 2021-06-17 13:10:01 -07:00
parent 8b657bbcb1
commit 2a6339cf21

View file

@ -162,13 +162,17 @@ class InteractionViews(TestCase):
view(request, status.id)
self.assertEqual(models.Boost.objects.count(), 1)
@patch("bookwyrm.activitystreams.ActivityStream.add_status")
def test_unboost(self, *_):
"""undo a boost"""
view = views.Unboost.as_view()
request = self.factory.post("")
request.user = self.remote_user
with patch("bookwyrm.activitystreams.ActivityStream.add_status"):
status = models.Status.objects.create(user=self.local_user, content="hi")
with patch(
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
):
views.Boost.as_view()(request, status.id)
self.assertEqual(models.Boost.objects.count(), 1)