mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 09:39:17 +02:00
Advertise list of known nodes on /api/v1/federation/domains and in nodeinfo if stats sharing is enabled
This commit is contained in:
parent
4adbf5f502
commit
002b3687a8
7 changed files with 60 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
import pytest
|
||||
|
||||
from django.urls import reverse
|
||||
|
||||
import funkwhale_api
|
||||
from funkwhale_api.instance import nodeinfo
|
||||
from funkwhale_api.federation import actors
|
||||
|
@ -10,6 +12,7 @@ from funkwhale_api.music import utils as music_utils
|
|||
def test_nodeinfo_dump(preferences, mocker, avatar):
|
||||
preferences["instance__banner"] = avatar
|
||||
preferences["instance__nodeinfo_stats_enabled"] = True
|
||||
preferences["common__api_authentication_required"] = False
|
||||
preferences["moderation__unauthenticated_report_types"] = [
|
||||
"takedown_request",
|
||||
"other",
|
||||
|
@ -91,6 +94,9 @@ def test_nodeinfo_dump(preferences, mocker, avatar):
|
|||
"instance__funkwhale_support_message_enabled"
|
||||
],
|
||||
"instanceSupportMessage": preferences["instance__support_message"],
|
||||
"knownNodesListUrl": federation_utils.full_url(
|
||||
reverse("api:v1:federation:domains-list")
|
||||
),
|
||||
},
|
||||
}
|
||||
assert nodeinfo.get() == expected
|
||||
|
@ -159,6 +165,7 @@ def test_nodeinfo_dump_stats_disabled(preferences, mocker):
|
|||
"instance__funkwhale_support_message_enabled"
|
||||
],
|
||||
"instanceSupportMessage": preferences["instance__support_message"],
|
||||
"knownNodesListUrl": None,
|
||||
},
|
||||
}
|
||||
assert nodeinfo.get() == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue