From b3cd9483d33d7273bec8bde68d147906b9ab025a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 7 Jul 2021 09:47:07 -0700 Subject: [PATCH] Adds test for misinterpreted links --- bookwyrm/tests/views/test_status.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bookwyrm/tests/views/test_status.py b/bookwyrm/tests/views/test_status.py index 9253e6e57..68ddcd289 100644 --- a/bookwyrm/tests/views/test_status.py +++ b/bookwyrm/tests/views/test_status.py @@ -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): '

hi and fish.com ' "is rad

", ) + 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, + '

fish.com/@hello#okay

', + ) + def test_to_markdown_link(self, _): """this is mostly handled in other places, but nonetheless""" text = "[hi](http://fish.com) is rad"