Suitable test name and comment

This commit is contained in:
Mouse Reeve 2021-04-15 17:48:43 -07:00
parent da453f8056
commit 80ea459711

View file

@ -30,13 +30,15 @@ class Activitystreams(TestCase):
) )
self.book = models.Edition.objects.create(title="test book") self.book = models.Edition.objects.create(title="test book")
def test_activitystream_class_ids(self, _): def test_populate_streams(self, _):
""" the abstract base class for stream objects """ """ make sure the function on the redis manager gets called """
with patch("bookwyrm.activitystreams.ActivityStream.add_status"): with patch("bookwyrm.activitystreams.ActivityStream.add_status"):
models.Comment.objects.create( models.Comment.objects.create(
user=self.local_user, content="hi", book=self.book user=self.local_user, content="hi", book=self.book
) )
with patch("bookwyrm.activitystreams.ActivityStream.populate_store") as redis_mock: with patch(
"bookwyrm.activitystreams.ActivityStream.populate_store"
) as redis_mock:
populate_streams() populate_streams()
self.assertEqual(redis_mock.call_count, 6) # 2 users x 3 streams self.assertEqual(redis_mock.call_count, 6) # 2 users x 3 streams