test_streams.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:socialhome 作者: jaywink 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号