kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
rebase and some test update
rodzic
7d2380e5f0
commit
b696c3bb9f
2
.env.dev
2
.env.dev
|
@ -18,6 +18,6 @@ MEDIA_ROOT=/data/media
|
|||
# FORCE_HTTPS_URLS=True
|
||||
|
||||
# Customize to your needs
|
||||
POSTGRES_VERSION=11
|
||||
POSTGRES_VERSION=12
|
||||
DEBUG=true
|
||||
TYPESENSE_API_KEY="apikey"
|
||||
|
|
|
@ -2,7 +2,7 @@ import logging.config
|
|||
import sys
|
||||
import warnings
|
||||
from collections import OrderedDict
|
||||
from urllib.parse import urlsplit
|
||||
from urllib.parse import urlsplit, urlparse
|
||||
from . import testing
|
||||
|
||||
import environ
|
||||
|
|
|
@ -15,7 +15,7 @@ v2_patterns += [
|
|||
r"^radios/",
|
||||
include(("funkwhale_api.radios.urls_v2", "radios"), namespace="radios"),
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^",
|
||||
include(
|
||||
("funkwhale_api.playlists.urls_v2", "playlists"), namespace="playlists"
|
||||
|
|
|
@ -31,6 +31,14 @@ def test_can_get_playlists_octet_stream(factories, logged_in_api_client):
|
|||
assert el.findtext("./title") == pl.name
|
||||
|
||||
|
||||
def test_can_get_playlists_json(factories, logged_in_api_client):
|
||||
pl = factories["playlists.Playlist"]()
|
||||
url = reverse("api:v2:playlists:playlists-detail", kwargs={"pk": pl.pk})
|
||||
response = logged_in_api_client.get(url, format="json")
|
||||
assert response.status_code == 200
|
||||
assert response.data["name"] == pl.name
|
||||
|
||||
|
||||
def test_can_get_user_playlists_list(factories, logged_in_api_client):
|
||||
user = factories["users.User"]()
|
||||
factories["playlists.Playlist"](user=user)
|
||||
|
@ -81,18 +89,6 @@ def test_can_patch_playlists_octet_stream(factories, logged_in_api_client):
|
|||
assert pl.playlist_tracks.all()[0].track.title == track.title
|
||||
|
||||
|
||||
def test_can_get_playlists_id(factories, logged_in_api_client):
|
||||
pl = factories["playlists.Playlist"]()
|
||||
url = reverse("api:v2:playlists:playlists-detail", kwargs={"pk": pl.pk})
|
||||
headers = {"Content-Type": "application/json"}
|
||||
|
||||
response = logged_in_api_client.get(url, headers=headers, format="json")
|
||||
assert response.status_code == 200
|
||||
assert (
|
||||
etree.fromstring(response.content.decode("utf-8")).findtext("title") == pl.name
|
||||
)
|
||||
|
||||
|
||||
def test_can_get_playlists_track(factories, logged_in_api_client):
|
||||
pl = factories["playlists.Playlist"]()
|
||||
plt = factories["playlists.PlaylistTrack"](playlist=pl)
|
||||
|
|
2
dev.yml
2
dev.yml
|
@ -25,7 +25,7 @@ services:
|
|||
env_file:
|
||||
- .env.dev
|
||||
- .env
|
||||
image: postgres:${POSTGRES_VERSION-11}-alpine
|
||||
image: postgres:${POSTGRES_VERSION-12}-alpine
|
||||
environment:
|
||||
- "POSTGRES_HOST_AUTH_METHOD=trust"
|
||||
command: postgres ${POSTGRES_ARGS-}
|
||||
|
|
Ładowanie…
Reference in New Issue