def test_get_content_ids__fills_in_non_cached_content_up_to_pagination_amount(self):
with patch.object(self.stream, "get_cached_content_ids") as mock_cached:
cached_ids = random.sample(range(10000, 100000), self.stream.paginate_by - 1)
throughs = dict(zip(cached_ids, cached_ids))
mock_cached.return_value = cached_ids, throughs
# Fills up with one of the two that are available
all_ids = set(cached_ids + [self.site_content.id])
self.assertEqual(set(self.stream.get_content_ids()[0]), all_ids)
评论列表
文章目录