mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 15:59:18 +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
|
@ -179,3 +179,21 @@ def test_can_detail_fetch(logged_in_api_client, factories):
|
|||
|
||||
assert response.status_code == 200
|
||||
assert response.data == expected
|
||||
|
||||
|
||||
def test_user_can_list_domains(factories, api_client, preferences):
|
||||
preferences["common__api_authentication_required"] = False
|
||||
allowed = factories["federation.Domain"]()
|
||||
factories["moderation.InstancePolicy"](
|
||||
actor=None, for_domain=True, block_all=True
|
||||
).target_domain
|
||||
url = reverse("api:v1:federation:domains-list")
|
||||
response = api_client.get(url)
|
||||
|
||||
expected = {
|
||||
"count": 1,
|
||||
"next": None,
|
||||
"previous": None,
|
||||
"results": [api_serializers.DomainSerializer(allowed).data],
|
||||
}
|
||||
assert response.data == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue