@@ -527,8 +527,26 @@ def test_export_discussion(self):
527527 )
528528 conversation = IConversation (doc1 )
529529 comment = createObject ("plone.Comment" )
530- comment .text = u"Comment text"
530+ comment .text = "Comment text"
531+
532+ comment_html = createObject ("plone.Comment" )
533+ comment_html .text = "Comment text <strong>with HTML</strong>"
534+ comment_html .mime_type = "text/html"
535+
536+ comment_intelligent_text = createObject ("plone.Comment" )
537+ comment_intelligent_text .text = "Comment text with link https://plone.org"
538+ comment_intelligent_text .mime_type = "text/x-web-intelligent"
539+
540+ comment_markdown = createObject ("plone.Comment" )
541+ comment_markdown .text = (
542+ "Comment text with link [Link to Plone](https://plone.org)"
543+ )
544+ comment_markdown .mime_type = "text/x-web-markdown"
545+
531546 conversation .addComment (comment )
547+ conversation .addComment (comment_html )
548+ conversation .addComment (comment_intelligent_text )
549+ conversation .addComment (comment_markdown )
532550 transaction .commit ()
533551
534552 browser = self .open_page ("@@export_discussion" )
@@ -538,9 +556,36 @@ def test_export_discussion(self):
538556 contents = DATA [- 1 ]
539557 data = json .loads (contents )
540558 self .assertEqual (data [0 ]["uuid" ], doc1 .UID ())
559+
541560 self .assertEqual (
542561 data [0 ]["conversation" ]["items" ][0 ]["text" ]["data" ], "Comment text"
543562 )
563+ self .assertEqual (
564+ data [0 ]["conversation" ]["items" ][0 ]["text" ]["mime-type" ], "text/plain"
565+ )
566+ self .assertEqual (
567+ data [0 ]["conversation" ]["items" ][1 ]["text" ]["data" ],
568+ "Comment text <strong>with HTML</strong>" ,
569+ )
570+ self .assertEqual (
571+ data [0 ]["conversation" ]["items" ][1 ]["text" ]["mime-type" ], "text/html"
572+ )
573+ self .assertEqual (
574+ data [0 ]["conversation" ]["items" ][2 ]["text" ]["data" ],
575+ "Comment text with link https://plone.org" ,
576+ )
577+ self .assertEqual (
578+ data [0 ]["conversation" ]["items" ][2 ]["text" ]["mime-type" ],
579+ "text/x-web-intelligent" ,
580+ )
581+ self .assertEqual (
582+ data [0 ]["conversation" ]["items" ][3 ]["text" ]["data" ],
583+ "Comment text with link [Link to Plone](https://plone.org)" ,
584+ )
585+ self .assertEqual (
586+ data [0 ]["conversation" ]["items" ][3 ]["text" ]["mime-type" ],
587+ "text/x-web-markdown" ,
588+ )
544589
545590 def test_export_ordering (self ):
546591 # First create some content.
0 commit comments