Verified Commit 8c95f84f authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Test for empty playlist

parent e92b49db
Pipeline #5386 passed with stages
in 2 minutes and 54 seconds
......@@ -246,3 +246,26 @@ def test_library_playlist(spa_html, no_api_auth, client, factories, settings):
# we only test our custom metas, not the default ones
assert metas[: len(expected_metas)] == expected_metas
def test_library_playlist_empty(spa_html, no_api_auth, client, factories, settings):
playlist = factories["playlists.Playlist"](privacy_level="everyone")
url = "/library/playlists/{}".format(playlist.pk)
response = client.get(url)
expected_metas = [
{
"tag": "meta",
"property": "og:url",
"content": utils.join_url(settings.FUNKWHALE_URL, url),
},
{"tag": "meta", "property": "og:title", "content": playlist.name},
{"tag": "meta", "property": "og:type", "content": "music.playlist"},
]
metas = utils.parse_meta(response.content.decode())
# we only test our custom metas, not the default ones
assert metas[: len(expected_metas)] == expected_metas
Supports Markdown
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