Example #1
0
    def test_equality(self, user, cover, made_for, play_counter, playlist_absence):
        a = Playlist(user, cover, made_for, play_counter, playlist_absence)
        b = Playlist(user, cover, made_for, play_counter, None)
        c = Playlist(user, None, made_for, play_counter, playlist_absence)
        d = Playlist(user, cover, made_for, play_counter, playlist_absence)

        assert a != b != c
        assert hash(a) != hash(b) != hash(c)
        assert a is not b is not c

        assert a == d
    def test_equality(self, user, cover, made_for, play_counter):
        a = Playlist(user, self.uid, self.kind, self.title, self.track_count,
                     cover, made_for, play_counter)
        b = Playlist(user, 123, self.kind, self.title, 10, cover, made_for,
                     play_counter)
        c = Playlist(user, self.uid, 321, self.title, self.track_count, None,
                     made_for, play_counter)
        d = Playlist(user, self.uid, self.kind, self.title, self.track_count,
                     cover, made_for, play_counter)

        assert a != b != c
        assert hash(a) != hash(b) != hash(c)
        assert a is not b is not c

        assert a == d
Example #3
0
 def get(self, similar_playlists, last_owner_playlists):
     return Playlist(
         user,
         cover,
         made_for,
         play_counter,
         playlist_absence,
         TestPlaylist.uid,
         TestPlaylist.kind,
         TestPlaylist.title,
         TestPlaylist.track_count,
         TestPlaylist.tags,
         TestPlaylist.revision,
         TestPlaylist.snapshot,
         TestPlaylist.visibility,
         TestPlaylist.collective,
         TestPlaylist.url_part,
         TestPlaylist.created,
         TestPlaylist.modified,
         TestPlaylist.available,
         TestPlaylist.is_banner,
         TestPlaylist.is_premiere,
         TestPlaylist.duration_ms,
         TestPlaylist.og_image,
         TestPlaylist.og_title,
         TestPlaylist.og_description,
         TestPlaylist.image,
         cover,
         contest,
         TestPlaylist.background_color,
         TestPlaylist.text_color,
         TestPlaylist.id_for_from,
         TestPlaylist.dummy_description,
         TestPlaylist.dummy_page_description,
         cover,
         cover,
         open_graph_data,
         brand,
         TestPlaylist.metrika_id,
         TestPlaylist.coauthors,
         [artist],
         [track_id],
         [track_short],
         TestPlaylist.prerolls,
         TestPlaylist.likes_count,
         similar_playlists,
         last_owner_playlists,
         TestPlaylist.generated_playlist_type,
         TestPlaylist.animated_cover_uri,
         TestPlaylist.ever_played,
         TestPlaylist.description,
         TestPlaylist.description_formatted,
         TestPlaylist.playlist_uuid,
         TestPlaylist.type,
         TestPlaylist.ready,
         TestPlaylist.is_for_from,
         TestPlaylist.regions,
     )
Example #4
0
 def get(self):
     return Playlist(user, cover, made_for, play_counter, playlist_absence, TestPlaylist.uid, TestPlaylist.kind,
                     TestPlaylist.title, TestPlaylist.track_count, TestPlaylist.tags, TestPlaylist.revision,
                     TestPlaylist.snapshot, TestPlaylist.visibility, TestPlaylist.collective,
                     TestPlaylist.created, TestPlaylist.modified, TestPlaylist.available, TestPlaylist.is_banner,
                     TestPlaylist.is_premiere, TestPlaylist.duration_ms, TestPlaylist.og_image, [track_short],
                     TestPlaylist.prerolls, TestPlaylist.likes_count, TestPlaylist.generated_playlist_type,
                     TestPlaylist.animated_cover_uri, TestPlaylist.ever_played, TestPlaylist.description,
                     TestPlaylist.description_formatted, TestPlaylist.is_for_from, TestPlaylist.regions)