Updates views tests
This commit is contained in:
@@ -18,7 +18,7 @@ class ListActionViews(TestCase):
|
||||
self.factory = RequestFactory()
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
), patch("bookwyrm.lists_stream.populate_lists_task.delay"):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse@local.com",
|
||||
"mouse@mouse.com",
|
||||
@@ -90,8 +90,9 @@ class ListActionViews(TestCase):
|
||||
request.user = self.local_user
|
||||
with patch(
|
||||
"bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"
|
||||
) as mock:
|
||||
) as mock, patch("bookwyrm.lists_stream.remove_list_task.delay") as redis_mock:
|
||||
views.delete_list(request, self.list.id)
|
||||
self.assertTrue(redis_mock.called)
|
||||
activity = json.loads(mock.call_args[1]["args"][1])
|
||||
self.assertEqual(activity["type"], "Delete")
|
||||
self.assertEqual(activity["actor"], self.local_user.remote_id)
|
||||
@@ -123,10 +124,7 @@ class ListActionViews(TestCase):
|
||||
|
||||
request = self.factory.post(
|
||||
"",
|
||||
{
|
||||
"item": pending.id,
|
||||
"approved": "true",
|
||||
},
|
||||
{"item": pending.id, "approved": "true"},
|
||||
)
|
||||
request.user = self.local_user
|
||||
|
||||
|
Reference in New Issue
Block a user