mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 22:38:26 +02:00
See #192: replaced old stats endpoint with nodeinfo
This commit is contained in:
parent
e31bed050e
commit
b4ad7a4a71
7 changed files with 239 additions and 15 deletions
22
api/tests/instance/test_views.py
Normal file
22
api/tests/instance/test_views.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from django.urls import reverse
|
||||
|
||||
|
||||
def test_nodeinfo_endpoint(db, api_client, mocker):
|
||||
payload = {
|
||||
'test': 'test'
|
||||
}
|
||||
mocked_nodeinfo = mocker.patch(
|
||||
'funkwhale_api.instance.nodeinfo.get', return_value=payload)
|
||||
url = reverse('api:v1:instance:nodeinfo')
|
||||
response = api_client.get(url)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.data == payload
|
||||
|
||||
|
||||
def test_nodeinfo_endpoint_disabled(db, api_client, preferences):
|
||||
preferences['instance__nodeinfo_enabled'] = False
|
||||
url = reverse('api:v1:instance:nodeinfo')
|
||||
response = api_client.get(url)
|
||||
|
||||
assert response.status_code == 404
|
Loading…
Add table
Add a link
Reference in a new issue