tests: Add test_render_message_api().

This commit is contained in:
Steve Howell 2016-09-19 11:44:15 -07:00 committed by Tim Abbott
parent d0f9374b71
commit 7d4995ded0
1 changed files with 14 additions and 0 deletions

View File

@ -566,6 +566,20 @@ class BugdownTest(TestCase):
'<p><a href="https://lists.debian.org/debian-ctte/2014/02/msg00173.html" target="_blank" title="https://lists.debian.org/debian-ctte/2014/02/msg00173.html">https://lists.debian.org/debian-ctte/2014/02/msg00173.html</a></p>', '<p><a href="https://lists.debian.org/debian-ctte/2014/02/msg00173.html" target="_blank" title="https://lists.debian.org/debian-ctte/2014/02/msg00173.html">https://lists.debian.org/debian-ctte/2014/02/msg00173.html</a></p>',
) )
class BugdownApiTests(ZulipTestCase):
def test_render_message_api(self):
# type: () -> None
content = 'That is a **bold** statement'
result = self.client_get(
'/api/v1/messages/render',
dict(content=content),
**self.api_auth('othello@zulip.com')
)
self.assert_json_success(result)
data = ujson.loads(result.content)
self.assertEqual(data['rendered'],
u'<p>That is a <strong>bold</strong> statement</p>')
class BugdownErrorTests(ZulipTestCase): class BugdownErrorTests(ZulipTestCase):
def test_bugdown_error_handling(self): def test_bugdown_error_handling(self):
# type: () -> None # type: () -> None