示例#1
0
 def test_to_html_unknown_format(self):
     filename = 'blah'
     content = 'This is just a random file'
     config = {'format': 'pdf'}
     page = Page(filename=filename, config=config, content=content)
     should_be = 'This is just a random file'
     with pytest.raises(NoRenderEngineError):
         page.to_html()
示例#2
0
 def test_to_html_unknown_format(self):
     filename = 'blah'
     content = 'This is just a random file'
     config = {'format': 'pdf'}
     page = Page(filename=filename, config=config, content=content)
     should_be = 'This is just a random file'
     with pytest.raises(NoRenderEngineError):
         page.to_html()
示例#3
0
 def test_to_html_html_format(self):
     filename = 'blah'
     content = 'This is just a random file'
     config = {'format': 'html'}
     page = Page(filename=filename, config=config, content=content)
     should_be = 'This is just a random file'
     assert page.to_html() == should_be
示例#4
0
 def test_to_html_html_format(self):
     filename = 'blah'
     content = 'This is just a random file'
     config = {'format': 'html'}
     page = Page(filename=filename, config=config, content=content)
     should_be = 'This is just a random file'
     assert page.to_html() == should_be
示例#5
0
 def test_to_html_no_markup_specified(self):
     filename = 'blah'
     content = 'This is just a random file'
     page = Page(filename=filename, content=content)
     should_be = '<p>This is just a random file</p>'
     assert page.to_html() == should_be
示例#6
0
 def test_to_html_no_markup_specified(self):
     filename = 'blah'
     content = 'This is just a random file'
     page = Page(filename=filename, content=content)
     should_be = '<p>This is just a random file</p>'
     assert page.to_html() == should_be