def test_get_content_ids__returns_cached_ids_if_enough_in_cache(self, mock_queryset):
stream = FollowedStream(user=self.user)
stream.paginate_by = 1
with patch.object(stream, "get_queryset") as mock_queryset, \
patch.object(stream, "get_cached_content_ids") as mock_cached:
mock_cached.return_value = [self.content1.id], {self.content1.id: self.content1.id}
stream.get_content_ids()
self.assertEqual(mock_queryset.call_count, 0)
评论列表
文章目录