add more test cases for link formatting

This commit is contained in:
reesporte 2021-08-30 11:12:27 -05:00
parent 5291308677
commit aa946e3ab7

View file

@ -303,6 +303,21 @@ class StatusViews(TestCase):
'<a href="%s">openlibrary.org/search'
"?q=arkady+strugatsky&mode=everything</a>" % url,
)
url = "https://tech.lgbt/@bookwyrm"
self.assertEqual(
views.status.format_links(url),
'<a href="%s">tech.lgbt/@bookwyrm</a>' % url
)
url = "users.speakeasy.net/~lion/nb/book.pdf"
self.assertEqual(
views.status.format_links(url),
'<a href="%s">users.speakeasy.net/~lion/nb/book.pdf</a>' % url
)
url = "pkm.one/#/page/The%20Book%20which%20launched%20a%201000%20Note%20taking%20apps"
self.assertEqual(
views.status.format_links(url),
'<a href="%s">%s</a>' % (url, url)
)
def test_to_markdown(self, *_):
"""this is mostly handled in other places, but nonetheless"""