def test_picture_baddatas2(self): """ Test with a song that must not return a cover """ song = Song.objects.create(artist='Foobar', album='Sure this album does not exists', title='Lorem ipsum', genre='Ipsum', score=0, played=0, family=0, global_score=0) response = picture(song) attend = {'picture': 'http://lorempixel.com/64/64/animals/'} self.assertEqual(response, attend)
def test_picture2(self): """ Test with a picture with cover """ song = Song.objects.create(artist='U2', album='Rattle and Hum', title='Love rescue me', genre='Rock', score=0, played=0, family=0, global_score=0) response = picture(song) url = u'http://userserve-ak.last.fm/serve/64s/57976973.png' attend = {'picture': url} self.assertEqual(response, attend)
def test_picture_baddatas(self): """ Test with a song that must nor return a cover """ song = Song.objects.create(artist='Foobar', album='Sure this album does not exists', title='Lorem ipsum', genre='Ipsum', score=0, played=0, family=0, global_score=0, cover='htt://foo.bar/img.png') response = picture(song) attend = {'picture': song.cover} self.assertEqual(response, attend)
def test_picture(self): """ Test with a picture with cover """ song = Song.objects.create(artist='Van Morrison', album='The Healing Game', title='Sometimes We Cry', genre='Blues', score=0, played=0, family=0, global_score=0, cover='htt://foo.bar/img.png') response = picture(song) attend = {'picture': song.cover} self.assertEqual(response, attend)