mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 23:28:26 +02:00
See #432: can now start a radio from a tag
This commit is contained in:
parent
3ce2f0d774
commit
918e7beb7e
6 changed files with 95 additions and 8 deletions
|
@ -197,16 +197,19 @@ def test_can_start_artist_radio(factories):
|
|||
|
||||
def test_can_start_tag_radio(factories):
|
||||
user = factories["users.User"]()
|
||||
factories["music.Upload"].create_batch(5)
|
||||
tag = factories["tags.Tag"]()
|
||||
good_files = factories["music.Upload"].create_batch(5, track__set_tags=[tag])
|
||||
good_tracks = [f.track for f in good_files]
|
||||
good_tracks = [
|
||||
factories["music.Track"](set_tags=[tag.name]),
|
||||
factories["music.Track"](album__set_tags=[tag.name]),
|
||||
factories["music.Track"](album__artist__set_tags=[tag.name]),
|
||||
]
|
||||
factories["music.Track"].create_batch(3, set_tags=["notrock"])
|
||||
|
||||
radio = radios.TagRadio()
|
||||
session = radio.start_session(user, related_object=tag)
|
||||
assert session.radio_type == "tag"
|
||||
|
||||
for i in range(5):
|
||||
for i in range(3):
|
||||
assert radio.pick(filter_playable=False) in good_tracks
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue