mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-15 21:31:26 +00:00
Fixes references to populate lists task
This commit is contained in:
parent
94250dab42
commit
f7c8a550cf
4 changed files with 7 additions and 5 deletions
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue