def setup_data(self): self.manual_feed = testobjects.make_manual_feed() self.feed_with_downloads = testobjects.make_feed() self.feed_without_downloads = testobjects.make_feed() self.audio_items = [] self.video_items = [] self.undownloaded_items = [] for i in xrange(10): self.audio_items.append( testobjects.make_file_item(self.feed_with_downloads, u'audio-item-%s' % i, ext='.mp3')) self.video_items.append( testobjects.make_file_item(self.manual_feed, u'video-item-%s' % i, ext='.avi')) self.undownloaded_items.append( testobjects.make_item(self.feed_without_downloads, u'feed-item-%s' % i)) self.audio_playlist = models.SavedPlaylist( u'My music', [i.id for i in self.audio_items]) # put some videos in the videos playlist. These will be sent back by # the server, even if SHARE_VIDEO is not set self.video_playlist_items = self.video_items[:5] self.video_playlist = models.SavedPlaylist( u'My best videos', [i.id for i in self.video_playlist_items]) app.db.finish_transaction() models.Item.change_tracker.reset()
def setup_playlist(self): self.manual_feed = testobjects.make_manual_feed() items = testobjects.add_items_to_feed(self.manual_feed, 10, file_items=True, prefix='playlist-') self.playlist = models.SavedPlaylist(u'playlist', [i.id for i in items]) self.playlist_items = items
def setup_data(self): self.manual_feed = testobjects.make_manual_feed() self.feed_with_downloads = testobjects.make_feed() self.feed_without_downloads = testobjects.make_feed() self.audio_items = [] self.video_items = [] self.undownloaded_items = [] for i in xrange(10): self.audio_items.append(testobjects.make_file_item( self.feed_with_downloads, u'audio-item-%s' % i, ext='.mp3')) self.video_items.append(testobjects.make_file_item( self.manual_feed, u'video-item-%s' % i, ext='.avi')) self.undownloaded_items.append(testobjects.make_item( self.feed_without_downloads, u'feed-item-%s' % i)) self.audio_playlist = models.SavedPlaylist(u'My music', [i.id for i in self.audio_items]) # put some videos in the videos playlist. These will be sent back by # the server, even if SHARE_VIDEO is not set self.video_playlist_items = self.video_items[:5] self.video_playlist = models.SavedPlaylist(u'My best videos', [i.id for i in self.video_playlist_items]) app.db.finish_transaction() models.Item.change_tracker.reset()