mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 13:29:16 +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
|
@ -99,3 +99,28 @@ def test_get_updated_fields(conf, mock_args, data, expected, mocker):
|
|||
)
|
||||
def test_join_url(start, end, expected):
|
||||
assert utils.join_url(start, end) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"text, content_type, expected",
|
||||
[
|
||||
("hello world", "text/markdown", "<p>hello world</p>"),
|
||||
("hello world", "text/plain", "<p>hello world</p>"),
|
||||
("<strong>hello world</strong>", "text/html", "<strong>hello world</strong>"),
|
||||
# images and other non whitelisted html should be removed
|
||||
("hello world\n", "text/markdown", "<p>hello world</p>"),
|
||||
(
|
||||
"hello world\n\n<script></script>\n\n<style></style>",
|
||||
"text/markdown",
|
||||
"<p>hello world</p>",
|
||||
),
|
||||
(
|
||||
"<p>hello world</p><script></script>\n\n<style></style>",
|
||||
"text/html",
|
||||
"<p>hello world</p>",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_render_html(text, content_type, expected):
|
||||
result = utils.render_html(text, content_type)
|
||||
assert result == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue