Commit 47b6b244 authored by Eliot Berriot's avatar Eliot Berriot 💬

More tests

parent 9d623c13
Pipeline #5628 passed with stages
in 4 minutes and 16 seconds
......@@ -470,12 +470,16 @@ def test_get_album_list2_by_genre(f, db, logged_in_api_client, factories):
@pytest.mark.parametrize("f", ["json"])
def test_get_songs_by_genre(f, db, logged_in_api_client, factories):
@pytest.mark.parametrize(
"tags_field",
["set_tags", "artist__set_tags", "album__set_tags", "album__artist__set_tags"],
)
def test_get_songs_by_genre(f, tags_field, db, logged_in_api_client, factories):
url = reverse("api:subsonic-get_songs_by_genre")
assert url.endswith("getSongsByGenre") is True
track1 = factories["music.Track"](playable=True, set_tags=["Rock"])
track2 = factories["music.Track"](playable=True, album__set_tags=["Rock"])
factories["music.Track"](playable=True, set_tags=["Pop"])
track1 = factories["music.Track"](playable=True, **{tags_field: ["Rock"]})
track2 = factories["music.Track"](playable=True, **{tags_field: ["Rock"]})
factories["music.Track"](playable=True, **{tags_field: ["Pop"]})
expected = {
"songsByGenre": {"song": serializers.get_song_list_data([track2, track1])}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment