mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-18 07:33:57 +00:00
Adds test for misinterpreted links
This commit is contained in:
parent
52713ec8d5
commit
b3cd9483d3
1 changed files with 10 additions and 0 deletions
|
@ -8,6 +8,7 @@ from bookwyrm import forms, models, views
|
|||
from bookwyrm.settings import DOMAIN
|
||||
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
@patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay")
|
||||
class StatusViews(TestCase):
|
||||
"""viewing and creating statuses"""
|
||||
|
@ -318,6 +319,15 @@ class StatusViews(TestCase):
|
|||
'<p><em>hi</em> and <a href="http://fish.com">fish.com</a> ' "is rad</p>",
|
||||
)
|
||||
|
||||
def test_to_markdown_detect_url(self, _):
|
||||
"""this is mostly handled in other places, but nonetheless"""
|
||||
text = "http://fish.com/@hello#okay"
|
||||
result = views.status.to_markdown(text)
|
||||
self.assertEqual(
|
||||
result,
|
||||
'<p><a href="http://fish.com/@hello#okay">fish.com/@hello#okay</a></p>',
|
||||
)
|
||||
|
||||
def test_to_markdown_link(self, _):
|
||||
"""this is mostly handled in other places, but nonetheless"""
|
||||
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
||||
|
|
Loading…
Reference in a new issue