This commit is contained in:
@@ -70,7 +70,50 @@ class TestCollection(unittest.TestCase):
|
||||
self.assertTrue(a.name == b.name == c.name == d.name == "artist")
|
||||
self.assertTrue(a.country == b.country == c.country == d.country)
|
||||
|
||||
"""
|
||||
def test_artist_artist_relation(self):
|
||||
artist = Artist(
|
||||
name="artist",
|
||||
main_album_list=[
|
||||
Album(
|
||||
title="album",
|
||||
song_list=[
|
||||
Song(title="song"),
|
||||
],
|
||||
artist_list=[
|
||||
Artist(name="artist"),
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
self.assertTrue(artist.id == artist.main_album_collection[0].song_collection[0].artist_collection[0].id)
|
||||
|
||||
def test_artist_collection_sync(self):
|
||||
album_1 = Album(
|
||||
title="album",
|
||||
song_list=[
|
||||
Song(title="song", main_artist_list=[Artist(name="artist")]),
|
||||
],
|
||||
artist_list=[
|
||||
Artist(name="artist"),
|
||||
]
|
||||
)
|
||||
|
||||
album_2 = Album(
|
||||
title="album",
|
||||
song_list=[
|
||||
Song(title="song", main_artist_list=[Artist(name="artist")]),
|
||||
],
|
||||
artist_list=[
|
||||
Artist(name="artist"),
|
||||
]
|
||||
)
|
||||
|
||||
album_1.merge(album_2)
|
||||
|
||||
self.assertTrue(id(album_1.artist_collection) == id(album_1.artist_collection))
|
||||
self.assertTrue(id(album_1.song_collection[0].main_artist_collection) == id(album_1.song_collection[0].main_artist_collection))
|
||||
|
||||
def test_song_artist_relations(self):
|
||||
a = self.complicated_object()
|
||||
b = a.main_album_collection[0].song_collection[0].main_artist_collection[0]
|
||||
@@ -80,7 +123,6 @@ class TestCollection(unittest.TestCase):
|
||||
self.assertTrue(a.id == b.id == c.id == d.id)
|
||||
self.assertTrue(a.name == b.name == c.name == d.name == "artist")
|
||||
self.assertTrue(a.country == b.country == c.country == d.country)
|
||||
"""
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user