mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 04:29:17 +02:00
See #170: add a description field on tracks, albums, tracks
This commit is contained in:
parent
424b9f133a
commit
2bc71eecfd
38 changed files with 653 additions and 59 deletions
|
@ -7,6 +7,7 @@ from django.urls import reverse
|
|||
import django_filters
|
||||
|
||||
from funkwhale_api.common import serializers
|
||||
from funkwhale_api.common import utils
|
||||
from funkwhale_api.users import models
|
||||
from funkwhale_api.federation import utils as federation_utils
|
||||
|
||||
|
@ -252,3 +253,17 @@ def test_attachment_serializer_remote_file(factories, to_api_date):
|
|||
serializer = serializers.AttachmentSerializer(attachment)
|
||||
|
||||
assert serializer.data == expected
|
||||
|
||||
|
||||
def test_content_serializer(factories):
|
||||
content = factories["common.Content"]()
|
||||
|
||||
expected = {
|
||||
"text": content.text,
|
||||
"content_type": content.content_type,
|
||||
"html": utils.render_html(content.text, content.content_type),
|
||||
}
|
||||
|
||||
serializer = serializers.ContentSerializer(content)
|
||||
|
||||
assert serializer.data == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue