From f7c8a550cf843c87edd3a12c09d74b304ef04cc1 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 10 Dec 2021 09:34:17 -0800 Subject: [PATCH] Fixes references to populate lists task --- bookwyrm/management/commands/populate_lists_streams.py | 2 +- bookwyrm/management/commands/populate_streams.py | 2 +- bookwyrm/tests/management/test_populate_lists_streams.py | 6 ++++-- bookwyrm/tests/management/test_populate_streams.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bookwyrm/management/commands/populate_lists_streams.py b/bookwyrm/management/commands/populate_lists_streams.py index 1cf488df..502b3b92 100644 --- a/bookwyrm/management/commands/populate_lists_streams.py +++ b/bookwyrm/management/commands/populate_lists_streams.py @@ -13,7 +13,7 @@ def populate_lists_streams(): print("This may take a long time! Please be patient.") for user in users: print(".", end="") - lists_stream.populate_lists_stream_task.delay(user.id) + lists_stream.populate_lists_task.delay(user.id) class Command(BaseCommand): diff --git a/bookwyrm/management/commands/populate_streams.py b/bookwyrm/management/commands/populate_streams.py index 6b537650..5f83670c 100644 --- a/bookwyrm/management/commands/populate_streams.py +++ b/bookwyrm/management/commands/populate_streams.py @@ -14,7 +14,7 @@ def populate_streams(stream=None): print("This may take a long time! Please be patient.") for user in users: print(".", end="") - lists_stream.populate_lists_stream_task.delay(user.id) + lists_stream.populate_lists_task.delay(user.id) for stream_key in streams: print(".", end="") activitystreams.populate_stream_task.delay(stream_key, user.id) diff --git a/bookwyrm/tests/management/test_populate_lists_streams.py b/bookwyrm/tests/management/test_populate_lists_streams.py index 45c5eb80..f5047460 100644 --- a/bookwyrm/tests/management/test_populate_lists_streams.py +++ b/bookwyrm/tests/management/test_populate_lists_streams.py @@ -7,6 +7,8 @@ from bookwyrm.management.commands.populate_lists_streams import populate_lists_s @patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async") +@patch("bookwyrm.activitystreams.add_status_task.delay") +@patch("bookwyrm.activitystreams.populate_stream_task.delay") class Activitystreams(TestCase): """using redis to build activity streams""" @@ -45,10 +47,10 @@ class Activitystreams(TestCase): ) self.book = models.Edition.objects.create(title="test book") - def test_populate_streams(self, _): + def test_populate_streams(self, *_): """make sure the function on the redis manager gets called""" with patch( - "bookwyrm.lists_stream.populate_lists_stream_task.delay" + "bookwyrm.lists_stream.populate_lists_task.delay" ) as list_mock: populate_lists_streams() self.assertEqual(list_mock.call_count, 2) # 2 users diff --git a/bookwyrm/tests/management/test_populate_streams.py b/bookwyrm/tests/management/test_populate_streams.py index c527b27b..c20a21ac 100644 --- a/bookwyrm/tests/management/test_populate_streams.py +++ b/bookwyrm/tests/management/test_populate_streams.py @@ -55,7 +55,7 @@ class Activitystreams(TestCase): with patch( "bookwyrm.activitystreams.populate_stream_task.delay" ) as redis_mock, patch( - "bookwyrm.lists_stream.populate_lists_stream_task.delay" + "bookwyrm.lists_stream.populate_lists_task.delay" ) as list_mock: populate_streams() self.assertEqual(redis_mock.call_count, 6) # 2 users x 3 streams