Adds test for misinterpreted links
This commit is contained in:
parent
52713ec8d5
commit
b3cd9483d3
|
@ -8,6 +8,7 @@ from bookwyrm import forms, models, views
|
||||||
from bookwyrm.settings import DOMAIN
|
from bookwyrm.settings import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=invalid-name
|
||||||
@patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay")
|
@patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay")
|
||||||
class StatusViews(TestCase):
|
class StatusViews(TestCase):
|
||||||
"""viewing and creating statuses"""
|
"""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>",
|
'<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, _):
|
def test_to_markdown_link(self, _):
|
||||||
"""this is mostly handled in other places, but nonetheless"""
|
"""this is mostly handled in other places, but nonetheless"""
|
||||||
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
||||||
|
|
Loading…
Reference in New Issue