See #170: expose/store actor URL over federation
This commit is contained in:
parent
447b7b164d
commit
b351ea67e2
10 changed files with 160 additions and 14 deletions
|
|
@ -1,3 +1,8 @@
|
|||
from django.urls import reverse
|
||||
|
||||
from funkwhale_api.federation import utils as federation_utils
|
||||
|
||||
|
||||
def test_channel(factories, now):
|
||||
channel = factories["audio.Channel"]()
|
||||
assert channel.artist is not None
|
||||
|
|
@ -5,3 +10,16 @@ def test_channel(factories, now):
|
|||
assert channel.attributed_to is not None
|
||||
assert channel.library is not None
|
||||
assert channel.creation_date >= now
|
||||
|
||||
|
||||
def test_channel_get_rss_url_local(factories):
|
||||
channel = factories["audio.Channel"](artist__local=True)
|
||||
expected = federation_utils.full_url(
|
||||
reverse("api:v1:channels-rss", kwargs={"uuid": channel.uuid})
|
||||
)
|
||||
assert channel.get_rss_url() == expected
|
||||
|
||||
|
||||
def test_channel_get_rss_url_remote(factories):
|
||||
channel = factories["audio.Channel"]()
|
||||
assert channel.get_rss_url() == channel.rss_url
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ def test_channel_serializer_representation(factories, to_api_date):
|
|||
channel.attributed_to
|
||||
).data,
|
||||
"metadata": {},
|
||||
"rss_url": channel.get_rss_url(),
|
||||
}
|
||||
expected["artist"]["description"] = common_serializers.ContentSerializer(
|
||||
content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue