another round of mocks

This commit is contained in:
Mouse Reeve
2021-09-06 18:39:14 -07:00
parent 59400511c9
commit 2653458e56
11 changed files with 38 additions and 61 deletions

View File

@ -1,4 +1,4 @@
""" tests incoming activities"""
"""tests incoming activities"""
from datetime import datetime
from unittest.mock import patch
@ -63,9 +63,7 @@ class InboxActivities(TestCase):
"actor": self.remote_user.remote_id,
"object": {"id": self.status.remote_id, "type": "Tombstone"},
}
with patch(
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
) as redis_mock:
with patch("bookwyrm.activitystreams.remove_status_task.delay") as redis_mock:
views.inbox.activity_task(activity)
self.assertTrue(redis_mock.called)
# deletion doens't remove the status, it turns it into a tombstone
@ -94,9 +92,7 @@ class InboxActivities(TestCase):
"actor": self.remote_user.remote_id,
"object": {"id": self.status.remote_id, "type": "Tombstone"},
}
with patch(
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
) as redis_mock:
with patch("bookwyrm.activitystreams.remove_status_task.delay") as redis_mock:
views.inbox.activity_task(activity)
self.assertTrue(redis_mock.called)
# deletion doens't remove the status, it turns it into a tombstone