def test_fetch_with_count_and_offset(self): # testing `count` parameter, count is the same as limit owner = GroupFactory(remote_id=GROUP_ID) album = AlbumFactory(remote_id=ALBUM_ID, owner=owner) video = VideoFactory(remote_id=VIDEO_ID, album=album, owner=owner) self.assertEqual(Comment.objects.count(), 0) comments = video.fetch_comments(count=5) self.assertEqual(len(comments), 5) self.assertEqual(Comment.objects.count(), 5) # testing `offset` parameter comments2 = video.fetch_comments(count=2, offset=4) self.assertEqual(len(comments2), 2) self.assertEqual(Comment.objects.count(), 6) self.assertEqual(comments[4].remote_id, comments2[0].remote_id)