test_activity.py 439 Bytes
Newer Older
1
def test_get_track_activity_url_mbid(factories):
Agate's avatar
Agate committed
2 3
    track = factories["music.Track"]()
    expected = "https://musicbrainz.org/recording/{}".format(track.mbid)
4 5 6 7
    assert track.get_activity_url() == expected


def test_get_track_activity_url_no_mbid(settings, factories):
Agate's avatar
Agate committed
8 9
    track = factories["music.Track"](mbid=None)
    expected = settings.FUNKWHALE_URL + "/tracks/{}".format(track.pk)
10
    assert track.get_activity_url() == expected