Updates management tests
This commit is contained in:
@ -25,6 +25,14 @@ class Activitystreams(TestCase):
|
||||
local=True,
|
||||
localname="nutria",
|
||||
)
|
||||
models.User.objects.create_user(
|
||||
"gerbil",
|
||||
"gerbil@gerbil.gerbil",
|
||||
"password",
|
||||
local=True,
|
||||
localname="gerbil",
|
||||
is_active=False,
|
||||
)
|
||||
with patch("bookwyrm.models.user.set_remote_server.delay"):
|
||||
self.remote_user = models.User.objects.create_user(
|
||||
"rat",
|
||||
@ -44,6 +52,11 @@ class Activitystreams(TestCase):
|
||||
user=self.local_user, content="hi", book=self.book
|
||||
)
|
||||
|
||||
with patch("bookwyrm.activitystreams.populate_stream_task.delay") as redis_mock:
|
||||
with patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
) as redis_mock, patch(
|
||||
"bookwyrm.lists_stream.populate_lists_stream_task.delay"
|
||||
) as list_mock:
|
||||
populate_streams()
|
||||
self.assertEqual(redis_mock.call_count, 6) # 2 users x 3 streams
|
||||
self.assertEqual(list_mock.call_count, 2) # 2 users
|
||||
|
Reference in New Issue
Block a user