mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Add failing tests for reported bugs in format_links()
This commit is contained in:
parent
294788aa1a
commit
7d13cbb10b
1 changed files with 7 additions and 0 deletions
|
@ -469,6 +469,13 @@ http://www.fish.com/"""
|
||||||
views.status.format_links(url), f'<a href="{url}">{url[8:]}</a>'
|
views.status.format_links(url), f'<a href="{url}">{url[8:]}</a>'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_format_links_ignore_non_urls(self, *_):
|
||||||
|
"""formating links should leave plain text untouced"""
|
||||||
|
text_elision = "> “The distinction is significant.” [...]" # bookwyrm#2993
|
||||||
|
text_quoteparens = "some kind of gene-editing technology (?)" # bookwyrm#3049
|
||||||
|
self.assertEqual(views.status.format_links(text_elision), text_elision)
|
||||||
|
self.assertEqual(views.status.format_links(text_quoteparens), text_quoteparens)
|
||||||
|
|
||||||
def test_format_mentions_with_at_symbol_links(self, *_):
|
def test_format_mentions_with_at_symbol_links(self, *_):
|
||||||
"""A link with an @username shouldn't treat the username as a mention"""
|
"""A link with an @username shouldn't treat the username as a mention"""
|
||||||
content = "a link to https://example.com/user/@mouse"
|
content = "a link to https://example.com/user/@mouse"
|
||||||
|
|
Loading…
Reference in a new issue