Fixes call to add_status signal

This commit is contained in:
Mouse Reeve 2021-11-12 10:19:13 -08:00
parent e6a251fdad
commit cad5a128ac

View file

@ -53,11 +53,12 @@ class ActivitystreamsSignals(TestCase):
status = models.Status.objects.create( status = models.Status.objects.create(
user=self.remote_user, content="hi", privacy="public" user=self.remote_user, content="hi", privacy="public"
) )
with patch("bookwyrm.activitystreams.add_status_task.delay") as mock: with patch("bookwyrm.activitystreams.add_status_task.apply_async") as mock:
activitystreams.add_status_on_create_command(models.Status, status, False) activitystreams.add_status_on_create_command(models.Status, status, False)
self.assertEqual(mock.call_count, 1) self.assertEqual(mock.call_count, 1)
args = mock.call_args[0] args = mock.call_args[1]
self.assertEqual(args[0], status.id) self.assertEqual(args["args"][0], status.id)
self.assertEqual(args["queue"], "high_priority")
def test_populate_streams_on_account_create(self, _): def test_populate_streams_on_account_create(self, _):
"""create streams for a user""" """create streams for a user"""