@@ -32,12 +32,15 @@ def test_form(self):
3232 "living" : "false" , # enable/disable live updates in preview
3333 "spellcheck" : "false" , # enable/disable spellcheck in form textareas # noqa: E501
3434 "hljs" : "true" , # enable/disable hljs highlighting in preview
35- }
35+ },
36+ MARTOR_MARKDOWN_BASE_EMOJI_URL = "https://github.githubassets.com/images/icons/emoji/" ,
37+ MARTOR_MARKDOWN_BASE_MENTION_URL = "https://python.web.id/author/" ,
3638 )
3739 def test_markdownify (self ):
3840 # Heading
3941 response = self .client .post (
40- "/martor/markdownify/" , {"content" : "# Hello world!" }
42+ "/martor/markdownify/" ,
43+ {"content" : "# Hello world!" },
4144 )
4245 self .assertEqual (response .status_code , 200 )
4346 self .assertEqual (
@@ -66,15 +69,26 @@ def test_markdownify(self):
6669 '<p><img alt="image" src="https://imgur.com/test.png"></p>' ,
6770 ) # noqa: E501
6871
72+ # Emoji
73+ response = self .client .post (
74+ "/martor/markdownify/" ,
75+ {"content" : ":heart:" },
76+ )
77+ self .assertEqual (response .status_code , 200 )
78+ self .assertEqual (
79+ response .content .decode ("utf-8" ),
80+ '<p><img class="marked-emoji" src="https://github.githubassets.com/images/icons/emoji/heart.png"></p>' ,
81+ ) # noqa: E501
82+
6983 # # Mention
7084 # response = self.client.post(
71- # ' /martor/markdownify/' ,
72- # {' content' : f' @[{self.user.username}]'}
85+ # " /martor/markdownify/" ,
86+ # {" content" : f" @[{self.user.username}]"},
7387 # )
7488 # self.assertEqual(response.status_code, 200)
7589 # self.assertEqual(
76- # response.content.decode(' utf-8' ),
77- # '...fixme'
90+ # response.content.decode(" utf-8" ),
91+ # f'<p><a class="direct-mention-link" href="https://python.web.id/author/{self.user.username}/">{self.user.username}</a></p>',
7892 # )
7993
8094 def test_markdownify_xss_handled (self ):
0 commit comments