2019-11-08 02:09:39 +09:00
|
|
|
|
from yandex_music import Playlist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestPlaylist:
|
2019-11-10 03:11:43 +09:00
|
|
|
|
uid = 503646255
|
|
|
|
|
kind = 69814820
|
|
|
|
|
title = 'Плейлист дня'
|
|
|
|
|
track_count = 57
|
|
|
|
|
tags = []
|
|
|
|
|
revision = 0
|
|
|
|
|
snapshot = 1
|
|
|
|
|
visibility = 'public'
|
|
|
|
|
collective = False
|
2020-06-06 18:37:03 +09:00
|
|
|
|
url_part = 'daily'
|
2019-11-10 03:11:43 +09:00
|
|
|
|
created = '2018-04-29T21:00:00+00:00'
|
|
|
|
|
modified = '2019-11-09T03:00:00+00:00'
|
|
|
|
|
available = True
|
|
|
|
|
is_banner = False
|
|
|
|
|
is_premiere = False
|
|
|
|
|
duration_ms = 12402690
|
|
|
|
|
og_image = 'avatars.yandex.net/get-music-user-playlist/38125/q0ahkhfQE3neTk/%%?1572609906461'
|
2020-06-06 18:37:03 +09:00
|
|
|
|
og_title = 'Плейлист дня'
|
Добавлен новый класс LicenceTextPart.
Поля cheapest, title, family_sub, fb_image, fb_name, family, intro_period_duration, intro_price, start_period_duration, start_price, licence_text_parts для Product.
Поля storage_dir, duplicates для Album.
Поле subscribed для ArtistEvent.
Поле description для GeneratedPlaylist.
Поле genre для Event.
Поле show_in_regions для Genre.
Поле cover_uri для MixLink.
Поля og_description, top_artist для Playlist.
Поля full_image_url, mts_full_image_url для Station.
Документация и тесты к новым поля. #339
2020-06-07 05:48:32 +09:00
|
|
|
|
og_description = 'Слушайте с пользой: подкасты, которые могут вам понравиться'
|
2020-06-06 18:37:03 +09:00
|
|
|
|
image = ''
|
|
|
|
|
background_color = ''
|
|
|
|
|
text_color = ''
|
|
|
|
|
id_for_from = 'playlist_of_the_day'
|
Добавлены новые классы: Brand, Contest, OpenGraphData.
Поля contest, dummy_description, dummy_page_description, dummy_cover, dummy_rollover_cover, og_data, branding классу Playlist.
Добавлена информацию по поводу запуска потока по треку, плейлисту и т.д.
Документация и тесты к новым полям, классам #339
2020-06-15 04:11:38 +09:00
|
|
|
|
dummy_description = 'Слушайте интересные подкасты, чтобы мы могли узнать вас получше и\\xa0собрать этот плейлист'
|
2021-02-03 21:28:10 +09:00
|
|
|
|
dummy_page_description = (
|
|
|
|
|
'Чтобы собрать для вас этот плейлист, мы должны узнать ' 'вас чуточку поближе. Слушайте больше!'
|
|
|
|
|
)
|
2020-06-14 21:09:50 +09:00
|
|
|
|
metrika_id = 666666
|
Метод de_list в TrackId.
Поля coauthors и recent_tracks в Playlist.
Поле regions в User.
Поля users, podcasts, podcast_episodes, type_, page, per_page в Search.
Поддержка новых типов поиска: подкасты, выпуски, пользователи.
Поля short_description, description, is_premiere, is_banner в Like.
Документация и тесты к новым поля. #339
2020-06-07 18:55:30 +09:00
|
|
|
|
coauthors = [1130000003905541]
|
2019-11-10 03:11:43 +09:00
|
|
|
|
prerolls = []
|
|
|
|
|
likes_count = 1
|
|
|
|
|
generated_playlist_type = 'playlistOfTheDay'
|
|
|
|
|
animated_cover_uri = 'avatars.yandex.net/get-music-user-playlist/30088/q0ahjvoZK5FT4A/%%'
|
|
|
|
|
ever_played = True
|
|
|
|
|
description = 'Каждый день — новый. Каждый день — ваш!'
|
|
|
|
|
description_formatted = 'Каждый день — новый. Каждый день — ваш!'
|
2021-01-28 01:24:40 +09:00
|
|
|
|
playlist_uuid = '5d06568a-9430-1df3-e066-6a32cf34d639'
|
2021-02-01 21:57:06 +09:00
|
|
|
|
type = 'missedLikes'
|
|
|
|
|
ready = True
|
2019-11-08 02:09:39 +09:00
|
|
|
|
is_for_from = None
|
|
|
|
|
regions = None
|
|
|
|
|
|
2021-02-03 21:28:10 +09:00
|
|
|
|
def test_expected_values(
|
|
|
|
|
self,
|
|
|
|
|
playlist,
|
|
|
|
|
user,
|
|
|
|
|
cover,
|
|
|
|
|
made_for,
|
|
|
|
|
track_short,
|
|
|
|
|
play_counter,
|
|
|
|
|
playlist_absence,
|
|
|
|
|
playlist_without_nested_playlists,
|
|
|
|
|
artist,
|
|
|
|
|
track_id,
|
|
|
|
|
contest,
|
|
|
|
|
open_graph_data,
|
|
|
|
|
brand,
|
|
|
|
|
):
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.owner == user
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.uid == self.uid
|
|
|
|
|
assert playlist.kind == self.kind
|
|
|
|
|
assert playlist.title == self.title
|
|
|
|
|
assert playlist.track_count == self.track_count
|
|
|
|
|
assert playlist.cover == cover
|
|
|
|
|
assert playlist.made_for == made_for
|
|
|
|
|
assert playlist.play_counter == play_counter
|
2019-11-24 08:23:24 +09:00
|
|
|
|
assert playlist.playlist_absence == playlist_absence
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.tags == self.tags
|
|
|
|
|
assert playlist.revision == self.revision
|
|
|
|
|
assert playlist.snapshot == self.snapshot
|
|
|
|
|
assert playlist.visibility == self.visibility
|
|
|
|
|
assert playlist.collective == self.collective
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.url_part == self.url_part
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.created == self.created
|
|
|
|
|
assert playlist.modified == self.modified
|
|
|
|
|
assert playlist.available == self.available
|
|
|
|
|
assert playlist.is_banner == self.is_banner
|
|
|
|
|
assert playlist.is_premiere == self.is_premiere
|
|
|
|
|
assert playlist.duration_ms == self.duration_ms
|
|
|
|
|
assert playlist.og_image == self.og_image
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.og_title == self.og_title
|
Добавлен новый класс LicenceTextPart.
Поля cheapest, title, family_sub, fb_image, fb_name, family, intro_period_duration, intro_price, start_period_duration, start_price, licence_text_parts для Product.
Поля storage_dir, duplicates для Album.
Поле subscribed для ArtistEvent.
Поле description для GeneratedPlaylist.
Поле genre для Event.
Поле show_in_regions для Genre.
Поле cover_uri для MixLink.
Поля og_description, top_artist для Playlist.
Поля full_image_url, mts_full_image_url для Station.
Документация и тесты к новым поля. #339
2020-06-07 05:48:32 +09:00
|
|
|
|
assert playlist.og_description == self.og_description
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.image == self.image
|
|
|
|
|
assert playlist.cover_without_text == cover
|
Добавлены новые классы: Brand, Contest, OpenGraphData.
Поля contest, dummy_description, dummy_page_description, dummy_cover, dummy_rollover_cover, og_data, branding классу Playlist.
Добавлена информацию по поводу запуска потока по треку, плейлисту и т.д.
Документация и тесты к новым полям, классам #339
2020-06-15 04:11:38 +09:00
|
|
|
|
assert playlist.contest == contest
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.background_color == self.background_color
|
|
|
|
|
assert playlist.text_color == self.text_color
|
|
|
|
|
assert playlist.id_for_from == self.id_for_from
|
Добавлены новые классы: Brand, Contest, OpenGraphData.
Поля contest, dummy_description, dummy_page_description, dummy_cover, dummy_rollover_cover, og_data, branding классу Playlist.
Добавлена информацию по поводу запуска потока по треку, плейлисту и т.д.
Документация и тесты к новым полям, классам #339
2020-06-15 04:11:38 +09:00
|
|
|
|
assert playlist.dummy_description == self.dummy_description
|
|
|
|
|
assert playlist.dummy_page_description == self.dummy_page_description
|
|
|
|
|
assert playlist.dummy_cover == cover
|
|
|
|
|
assert playlist.dummy_rollover_cover == cover
|
|
|
|
|
assert playlist.og_data == open_graph_data
|
|
|
|
|
assert playlist.branding == brand
|
2020-06-14 21:09:50 +09:00
|
|
|
|
assert playlist.metrika_id == self.metrika_id
|
Метод de_list в TrackId.
Поля coauthors и recent_tracks в Playlist.
Поле regions в User.
Поля users, podcasts, podcast_episodes, type_, page, per_page в Search.
Поддержка новых типов поиска: подкасты, выпуски, пользователи.
Поля short_description, description, is_premiere, is_banner в Like.
Документация и тесты к новым поля. #339
2020-06-07 18:55:30 +09:00
|
|
|
|
assert playlist.coauthors == self.coauthors
|
Добавлен новый класс LicenceTextPart.
Поля cheapest, title, family_sub, fb_image, fb_name, family, intro_period_duration, intro_price, start_period_duration, start_price, licence_text_parts для Product.
Поля storage_dir, duplicates для Album.
Поле subscribed для ArtistEvent.
Поле description для GeneratedPlaylist.
Поле genre для Event.
Поле show_in_regions для Genre.
Поле cover_uri для MixLink.
Поля og_description, top_artist для Playlist.
Поля full_image_url, mts_full_image_url для Station.
Документация и тесты к новым поля. #339
2020-06-07 05:48:32 +09:00
|
|
|
|
assert playlist.top_artist == [artist]
|
Метод de_list в TrackId.
Поля coauthors и recent_tracks в Playlist.
Поле regions в User.
Поля users, podcasts, podcast_episodes, type_, page, per_page в Search.
Поддержка новых типов поиска: подкасты, выпуски, пользователи.
Поля short_description, description, is_premiere, is_banner в Like.
Документация и тесты к новым поля. #339
2020-06-07 18:55:30 +09:00
|
|
|
|
assert playlist.recent_tracks == [track_id]
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.tracks == [track_short]
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.prerolls == self.prerolls
|
|
|
|
|
assert playlist.likes_count == self.likes_count
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.similar_playlists == [playlist_without_nested_playlists]
|
|
|
|
|
assert playlist.last_owner_playlists == [playlist_without_nested_playlists]
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.generated_playlist_type == self.generated_playlist_type
|
|
|
|
|
assert playlist.animated_cover_uri == self.animated_cover_uri
|
|
|
|
|
assert playlist.ever_played == self.ever_played
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.description == self.description
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.description_formatted == self.description_formatted
|
2021-01-28 01:24:40 +09:00
|
|
|
|
assert playlist.playlist_uuid == self.playlist_uuid
|
2021-02-01 21:57:06 +09:00
|
|
|
|
assert playlist.type == self.type
|
|
|
|
|
assert playlist.ready == self.ready
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.is_for_from == self.is_for_from
|
|
|
|
|
assert playlist.regions == self.regions
|
|
|
|
|
|
2019-12-29 16:38:24 +09:00
|
|
|
|
def test_de_json_none(self, client):
|
|
|
|
|
assert Playlist.de_json({}, client) is None
|
|
|
|
|
|
2019-12-29 17:06:27 +09:00
|
|
|
|
def test_de_list_none(self, client):
|
|
|
|
|
assert Playlist.de_list({}, client) == []
|
|
|
|
|
|
2019-11-24 08:23:24 +09:00
|
|
|
|
def test_de_json_required(self, client, user, cover, made_for, play_counter, playlist_absence):
|
2021-02-03 21:28:10 +09:00
|
|
|
|
json_dict = {
|
|
|
|
|
'owner': user.to_dict(),
|
|
|
|
|
'cover': cover.to_dict(),
|
|
|
|
|
'made_for': made_for.to_dict(),
|
|
|
|
|
'play_counter': play_counter.to_dict(),
|
|
|
|
|
'playlist_absence': playlist_absence.to_dict(),
|
|
|
|
|
}
|
2019-11-08 02:09:39 +09:00
|
|
|
|
playlist = Playlist.de_json(json_dict, client)
|
|
|
|
|
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.owner == user
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.cover == cover
|
|
|
|
|
assert playlist.made_for == made_for
|
|
|
|
|
assert playlist.play_counter == play_counter
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.playlist_absence == playlist_absence
|
2019-11-08 02:09:39 +09:00
|
|
|
|
|
2021-02-03 21:28:10 +09:00
|
|
|
|
def test_de_json_all(
|
|
|
|
|
self,
|
|
|
|
|
client,
|
|
|
|
|
user,
|
|
|
|
|
cover,
|
|
|
|
|
made_for,
|
|
|
|
|
track_short,
|
|
|
|
|
play_counter,
|
|
|
|
|
playlist_absence,
|
|
|
|
|
playlist_without_nested_playlists,
|
|
|
|
|
artist,
|
|
|
|
|
track_id,
|
|
|
|
|
contest,
|
|
|
|
|
open_graph_data,
|
|
|
|
|
brand,
|
|
|
|
|
):
|
|
|
|
|
json_dict = {
|
|
|
|
|
'owner': user.to_dict(),
|
|
|
|
|
'uid': self.uid,
|
|
|
|
|
'kind': self.kind,
|
|
|
|
|
'title': self.title,
|
|
|
|
|
'track_count': self.track_count,
|
|
|
|
|
'cover': cover.to_dict(),
|
|
|
|
|
'made_for': made_for.to_dict(),
|
|
|
|
|
'play_counter': play_counter.to_dict(),
|
|
|
|
|
'playlist_absence': playlist_absence.to_dict(),
|
|
|
|
|
'tags': self.tags,
|
|
|
|
|
'revision': self.revision,
|
|
|
|
|
'snapshot': self.snapshot,
|
|
|
|
|
'visibility': self.visibility,
|
|
|
|
|
'collective': self.collective,
|
|
|
|
|
'created': self.created,
|
|
|
|
|
'modified': self.modified,
|
|
|
|
|
'available': self.available,
|
|
|
|
|
'is_banner': self.is_banner,
|
|
|
|
|
'is_premiere': self.is_premiere,
|
|
|
|
|
'duration_ms': self.duration_ms,
|
|
|
|
|
'og_image': self.og_image,
|
|
|
|
|
'tracks': [track_short.to_dict()],
|
|
|
|
|
'prerolls': self.prerolls,
|
|
|
|
|
'likes_count': self.likes_count,
|
|
|
|
|
'generated_playlist_type': self.generated_playlist_type,
|
|
|
|
|
'url_part': self.url_part,
|
|
|
|
|
'animated_cover_uri': self.animated_cover_uri,
|
|
|
|
|
'ever_played': self.ever_played,
|
|
|
|
|
'description': self.description,
|
|
|
|
|
'description_formatted': self.description_formatted,
|
|
|
|
|
'is_for_from': self.is_for_from,
|
|
|
|
|
'regions': self.regions,
|
|
|
|
|
'og_title': self.og_title,
|
|
|
|
|
'image': self.image,
|
|
|
|
|
'id_for_from': self.id_for_from,
|
|
|
|
|
'background_color': self.background_color,
|
|
|
|
|
'text_color': self.text_color,
|
|
|
|
|
'cover_without_text': cover.to_dict(),
|
|
|
|
|
'coauthors': self.coauthors,
|
|
|
|
|
'similar_playlists': [playlist_without_nested_playlists.to_dict()],
|
|
|
|
|
'last_owner_playlists': [playlist_without_nested_playlists.to_dict()],
|
|
|
|
|
'og_description': self.og_description,
|
|
|
|
|
'top_artist': [artist.to_dict()],
|
|
|
|
|
'recent_tracks': [track_id.to_dict()],
|
|
|
|
|
'metrika_id': self.metrika_id,
|
|
|
|
|
'contest': contest.to_dict(),
|
|
|
|
|
'dummy_description': self.dummy_description,
|
|
|
|
|
'dummy_page_description': self.dummy_page_description,
|
|
|
|
|
'dummy_cover': cover.to_dict(),
|
|
|
|
|
'dummy_rollover_cover': cover.to_dict(),
|
|
|
|
|
'og_data': open_graph_data.to_dict(),
|
|
|
|
|
'branding': brand.to_dict(),
|
|
|
|
|
'playlist_uuid': self.playlist_uuid,
|
2021-09-19 22:47:19 +09:00
|
|
|
|
'type': self.type,
|
2021-02-03 21:28:10 +09:00
|
|
|
|
'ready': self.ready,
|
|
|
|
|
}
|
2019-11-08 02:09:39 +09:00
|
|
|
|
playlist = Playlist.de_json(json_dict, client)
|
|
|
|
|
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.owner == user
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.uid == self.uid
|
|
|
|
|
assert playlist.kind == self.kind
|
|
|
|
|
assert playlist.title == self.title
|
|
|
|
|
assert playlist.track_count == self.track_count
|
|
|
|
|
assert playlist.cover == cover
|
|
|
|
|
assert playlist.made_for == made_for
|
|
|
|
|
assert playlist.play_counter == play_counter
|
2019-11-24 08:23:24 +09:00
|
|
|
|
assert playlist.playlist_absence == playlist_absence
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.tags == self.tags
|
|
|
|
|
assert playlist.revision == self.revision
|
|
|
|
|
assert playlist.snapshot == self.snapshot
|
|
|
|
|
assert playlist.visibility == self.visibility
|
|
|
|
|
assert playlist.collective == self.collective
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.url_part == self.url_part
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.created == self.created
|
|
|
|
|
assert playlist.modified == self.modified
|
|
|
|
|
assert playlist.available == self.available
|
|
|
|
|
assert playlist.is_banner == self.is_banner
|
|
|
|
|
assert playlist.is_premiere == self.is_premiere
|
|
|
|
|
assert playlist.duration_ms == self.duration_ms
|
|
|
|
|
assert playlist.og_image == self.og_image
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.og_title == self.og_title
|
Добавлен новый класс LicenceTextPart.
Поля cheapest, title, family_sub, fb_image, fb_name, family, intro_period_duration, intro_price, start_period_duration, start_price, licence_text_parts для Product.
Поля storage_dir, duplicates для Album.
Поле subscribed для ArtistEvent.
Поле description для GeneratedPlaylist.
Поле genre для Event.
Поле show_in_regions для Genre.
Поле cover_uri для MixLink.
Поля og_description, top_artist для Playlist.
Поля full_image_url, mts_full_image_url для Station.
Документация и тесты к новым поля. #339
2020-06-07 05:48:32 +09:00
|
|
|
|
assert playlist.og_description == self.og_description
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.image == self.image
|
|
|
|
|
assert playlist.cover_without_text == cover
|
Добавлены новые классы: Brand, Contest, OpenGraphData.
Поля contest, dummy_description, dummy_page_description, dummy_cover, dummy_rollover_cover, og_data, branding классу Playlist.
Добавлена информацию по поводу запуска потока по треку, плейлисту и т.д.
Документация и тесты к новым полям, классам #339
2020-06-15 04:11:38 +09:00
|
|
|
|
assert playlist.contest == contest
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.background_color == self.background_color
|
|
|
|
|
assert playlist.text_color == self.text_color
|
|
|
|
|
assert playlist.id_for_from == self.id_for_from
|
Добавлены новые классы: Brand, Contest, OpenGraphData.
Поля contest, dummy_description, dummy_page_description, dummy_cover, dummy_rollover_cover, og_data, branding классу Playlist.
Добавлена информацию по поводу запуска потока по треку, плейлисту и т.д.
Документация и тесты к новым полям, классам #339
2020-06-15 04:11:38 +09:00
|
|
|
|
assert playlist.dummy_description == self.dummy_description
|
|
|
|
|
assert playlist.dummy_page_description == self.dummy_page_description
|
|
|
|
|
assert playlist.dummy_cover == cover
|
|
|
|
|
assert playlist.dummy_rollover_cover == cover
|
|
|
|
|
assert playlist.og_data == open_graph_data
|
|
|
|
|
assert playlist.branding == brand
|
2020-06-14 21:09:50 +09:00
|
|
|
|
assert playlist.metrika_id == self.metrika_id
|
Метод de_list в TrackId.
Поля coauthors и recent_tracks в Playlist.
Поле regions в User.
Поля users, podcasts, podcast_episodes, type_, page, per_page в Search.
Поддержка новых типов поиска: подкасты, выпуски, пользователи.
Поля short_description, description, is_premiere, is_banner в Like.
Документация и тесты к новым поля. #339
2020-06-07 18:55:30 +09:00
|
|
|
|
assert playlist.coauthors == self.coauthors
|
Добавлен новый класс LicenceTextPart.
Поля cheapest, title, family_sub, fb_image, fb_name, family, intro_period_duration, intro_price, start_period_duration, start_price, licence_text_parts для Product.
Поля storage_dir, duplicates для Album.
Поле subscribed для ArtistEvent.
Поле description для GeneratedPlaylist.
Поле genre для Event.
Поле show_in_regions для Genre.
Поле cover_uri для MixLink.
Поля og_description, top_artist для Playlist.
Поля full_image_url, mts_full_image_url для Station.
Документация и тесты к новым поля. #339
2020-06-07 05:48:32 +09:00
|
|
|
|
assert playlist.top_artist == [artist]
|
Метод de_list в TrackId.
Поля coauthors и recent_tracks в Playlist.
Поле regions в User.
Поля users, podcasts, podcast_episodes, type_, page, per_page в Search.
Поддержка новых типов поиска: подкасты, выпуски, пользователи.
Поля short_description, description, is_premiere, is_banner в Like.
Документация и тесты к новым поля. #339
2020-06-07 18:55:30 +09:00
|
|
|
|
assert playlist.recent_tracks == [track_id]
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.tracks == [track_short]
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.prerolls == self.prerolls
|
|
|
|
|
assert playlist.likes_count == self.likes_count
|
2020-06-06 18:37:03 +09:00
|
|
|
|
assert playlist.similar_playlists == [playlist_without_nested_playlists]
|
|
|
|
|
assert playlist.last_owner_playlists == [playlist_without_nested_playlists]
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.generated_playlist_type == self.generated_playlist_type
|
|
|
|
|
assert playlist.animated_cover_uri == self.animated_cover_uri
|
|
|
|
|
assert playlist.ever_played == self.ever_played
|
2019-11-10 03:11:43 +09:00
|
|
|
|
assert playlist.description == self.description
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.description_formatted == self.description_formatted
|
2021-01-28 01:24:40 +09:00
|
|
|
|
assert playlist.playlist_uuid == self.playlist_uuid
|
2021-02-01 21:57:06 +09:00
|
|
|
|
assert playlist.type == self.type
|
|
|
|
|
assert playlist.ready == self.ready
|
2019-11-08 02:09:39 +09:00
|
|
|
|
assert playlist.is_for_from == self.is_for_from
|
|
|
|
|
assert playlist.regions == self.regions
|
|
|
|
|
|
2019-11-24 08:23:24 +09:00
|
|
|
|
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)
|
2019-11-10 03:11:43 +09:00
|
|
|
|
|
|
|
|
|
assert a != b != c
|
|
|
|
|
assert hash(a) != hash(b) != hash(c)
|
|
|
|
|
assert a is not b is not c
|
|
|
|
|
|
|
|
|
|
assert a == d
|