Ejemplo n.º 1
0
 def test_create_compil(self):
     delivery = IDOLDelivery(datapaths.compil1_path)
     artist_mapper = ArtistMapper(vendor=self.idol_vendor, delivery=delivery)
     produced_artist = artist_mapper.create()
     expected_name = "%s (compilation)" % (delivery.release.title,)
     expected_url = latin1_to_ascii(('-').join(delivery.release.title.split())).lower()
     self.assertEqual(expected_name, produced_artist.name)
     self.assertEqual(expected_url, produced_artist.url)
     self.assertEqual('compilation', produced_artist.type)
     self.assertEqual(0, len(produced_artist.artistvendor_set.all()))
     self._check_commons(produced_artist)
Ejemplo n.º 2
0
 def _post_init(self, artist):
     artist.created = date.today()
     artist.url = latin1_to_ascii(('-').join(artist.url.split())).lower()
Ejemplo n.º 3
0
 def _create_filename(self):
     max_length = 30
     artist_name = self.track.album.artist.name[0:max_length]
     track_title = self.track.title[0:max_length]
     tmp_filename =  "%s__%s.%s" % (artist_name, track_title, self.delivery_audiofile.format)
     return latin1_to_ascii(tmp_filename.replace(" ", "_"))