Set up initial configuration for installing

Set up player config for mobile control
This commit is contained in:
Ciarán Ainsworth 2020-01-08 12:16:41 +01:00 committed by Eliot Berriot
commit 2302dc0581
16 changed files with 1012 additions and 26 deletions

View file

@ -1,3 +1,5 @@
import json
from django.urls import reverse
@ -37,3 +39,25 @@ def test_admin_settings_correct_permission(db, logged_in_api_client, preferences
assert response.status_code == 200
assert len(response.data) == len(preferences.all())
def test_manifest_endpoint(api_client, mocker, preferences, tmp_path, settings):
settings.FUNKWHALE_SPA_HTML_ROOT = str(tmp_path / "index.html")
preferences["instance__name"] = "Test pod"
preferences["instance__short_description"] = "Test description"
base_payload = {
"foo": "bar",
}
manifest = tmp_path / "manifest.json"
expected = {
"foo": "bar",
"name": "Test pod",
"short_name": "Test pod",
"description": "Test description",
}
manifest.write_bytes(json.dumps(base_payload).encode())
url = reverse("api:v1:instance:spa-manifest")
response = api_client.get(url)
assert response.status_code == 200
assert response.data == expected