def test_page_size(self, s3): s3.expects('get_authenticated_url').returns('<s3 url>') create_audio_file(make_mp3=True, make_ogg=True, artist='Aphex Twin') resp = self.get(extra_req={'page_size': 1}) eq_(resp.status_code, 200) data = json.loads(resp.content) eq_([d['artist'] for d in data['tracks']], ['Gescom'])
def test_delete_tracks(self, s3): tr = create_audio_file(source=self.sample_path, make_mp3=True, make_ogg=True, session=self.session) for tf in tr.files.all().order_by('created'): s3.expects('delete_key').with_args(tf.s3_url) tasks.delete_tracks([tr.pk]) tr = Track.objects.get(pk=tr.pk) eq_(tr.is_active, False) for tf in TrackFile.objects.filter(track=tr): eq_(tf.is_active, False)
def setUp(self): self.af = create_audio_file(make_mp3=True, make_ogg=True)
def audio_file(self, sample_file=None): if not sample_file: sample_file = self.sample_path return create_audio_file(source=sample_file)