comparison genshi/template/tests/plugin.py @ 659:7aebde54c10f experimental-sandboxed

merged trunk into sandbox branch
author aronacher
date Thu, 29 Nov 2007 18:07:32 +0000
parents 1da8de3e5e51
children 4bc6741b2811
comparison
equal deleted inserted replaced
648:4ad264337a50 659:7aebde54c10f
143 <h1>Test</h1> 143 <h1>Test</h1>
144 <p>Hello</p> 144 <p>Hello</p>
145 </body> 145 </body>
146 </html>""", output) 146 </html>""", output)
147 147
148 def test_render_fragment_with_doctype(self):
149 plugin = MarkupTemplateEnginePlugin(options={
150 'genshi.default_doctype': 'html-strict',
151 })
152 tmpl = plugin.load_template(PACKAGE + '.templates.test_no_doctype')
153 output = plugin.render({'message': 'Hello'}, template=tmpl,
154 fragment=True)
155 self.assertEqual("""<html lang="en">
156 <head>
157 <title>Test</title>
158 </head>
159 <body>
160 <h1>Test</h1>
161 <p>Hello</p>
162 </body>
163 </html>""", output)
164
148 def test_helper_functions(self): 165 def test_helper_functions(self):
149 plugin = MarkupTemplateEnginePlugin() 166 plugin = MarkupTemplateEnginePlugin()
150 tmpl = plugin.load_template(PACKAGE + '.templates.functions') 167 tmpl = plugin.load_template(PACKAGE + '.templates.functions')
151 output = plugin.render({'snippet': '<b>Foo</b>'}, template=tmpl) 168 output = plugin.render({'snippet': '<b>Foo</b>'}, template=tmpl)
152 self.assertEqual("""<div> 169 self.assertEqual("""<div>
Copyright (C) 2012-2017 Edgewall Software