diff --git a/api/tests.py b/api/tests.py
index 520943b..b24b9e4 100644
--- a/api/tests.py
+++ b/api/tests.py
@@ -141,6 +141,54 @@ class NewsApiTests(ApiTestBase):
self.assertEqual(response.status_code, 404)
+ def test_body_markdown_is_rendered_to_html(self):
+ self.make_news(body="## Big win\n\nWe beat **Rivals FC** 4-2. [Full report](https://example.com).")
+
+ body = self.api_get("/news/").json()["results"][0]["body"]
+
+ self.assertIn("
Big win
", body)
+ self.assertIn("Rivals FC", body)
+ self.assertIn('href="https://example.com"', body)
+ self.assertIn(">Full report", body)
+
+ def test_body_markdown_a_single_newline_becomes_a_line_break(self):
+ self.make_news(body="Line one\nLine two")
+
+ body = self.api_get("/news/").json()["results"][0]["body"]
+
+ self.assertIn("Line one
alert('xss')world")
+
+ body = self.api_get("/news/").json()["results"][0]["body"]
+
+ self.assertNotIn("