Пример #1
0
 def test_artist_track1popularity(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.track1popularity
     self.assertEqual(result, 80)
Пример #2
0
 def test_artist_imageLink(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.imageLink
     self.assertTrue(isinstance(result, str))
Пример #3
0
 def test_artist_track1(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.track1
     self.assertEqual(result, "TiK ToK")
Пример #4
0
 def test_artist_followers(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.followers
     self.assertTrue(isinstance(result, int))
Пример #5
0
 def test_artist_spotifyID(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.spotifyID
     self.assertTrue(isinstance(result, str))
Пример #6
0
 def test_artist_popularity(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.popularity
     self.assertTrue(isinstance(result, int))
Пример #7
0
 def test_artist_genres(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.genres
     self.assertTrue(result)  #check not empty
Пример #8
0
 def test_artist_bio(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.bio
     self.assertTrue(isinstance(result, str))
Пример #9
0
 def test_artist_name(self):
     artist = Artist.create("kesha", "ACL")
     result = artist.name
     self.assertEqual(result, "Kesha")
Пример #10
0
from webapp.models import Artist, Concerts

artistlist = Artist.objects.all()
for artist in artistlist:
    artist.delete()
    
concertlist = Concerts.objects.all()
for c in concertlist:
    artist = Artist.create(c.artists[0], c.concertName)
    if artist is not None:
        try:
            artist.save()
        except:
            continue