Example #1
0
 def test_html_format_default(self):
     markups.MARKUP_LANGUAGE = None
     self.assertEquals(html_format(''), '')
     self.assertEquals(html_format('Content'), '<p>Content</p>')
     self.assertEquals(html_format('Content</p>'), 'Content</p>')
     self.assertEquals(html_format('Hello\nworld!'),
                       '<p>Hello<br />world!</p>')
Example #2
0
 def test_html_content_restructuredtext(self):
     markups.MARKUP_LANGUAGE = 'restructuredtext'
     value = 'Hello world !\n\n' \
             'this is my content :\n\n' \
             '* Item 1\n* Item 2'
     self.assertEqual(html_format(value),
                      '<p>Hello world !</p>\n'
                      '<p>this is my content :</p>'
                      '\n<ul class="simple">\n<li>Item 1</li>\n'
                      '<li>Item 2</li>\n</ul>\n')
Example #3
0
 def test_html_content_markdown(self):
     markups.MARKUP_LANGUAGE = 'markdown'
     value = 'Hello world !\n\n' \
             'this is my content :\n\n' \
             '* Item 1\n* Item 2'
     self.assertEqual(html_format(value),
                      '<p>Hello world !</p>\n'
                      '<p>this is my content :</p>'
                      '\n<ul>\n<li>Item 1</li>\n'
                      '<li>Item 2</li>\n</ul>')
Example #4
0
 def test_html_content_textitle(self):
     markups.MARKUP_LANGUAGE = 'textile'
     value = 'Hello world !\n\n' \
             'this is my content :\n\n' \
             '* Item 1\n* Item 2'
     self.assertEqual(html_format(value),
                      '\t<p>Hello world !</p>\n\n\t'
                      '<p>this is my content :</p>\n\n\t'
                      '<ul>\n\t\t<li>Item 1</li>\n\t\t'
                      '<li>Item 2</li>\n\t</ul>')
Example #5
0
 def html_lead(self):
     """
     Returns the "lead" field formatted in HTML.
     """
     return html_format(self.lead)
Example #6
0
 def html_content(self):
     """
     Returns the "content" field formatted in HTML.
     """
     return html_format(self.content)
Example #7
0
 def html_lead(self):
     """
     Returns the "lead" field formatted in HTML.
     """
     return html_format(self.lead)
Example #8
0
 def html_content(self):
     """
     Returns the "content" field formatted in HTML.
     """
     return html_format(self.content)