def test_helper_functions(self): plugin = TextTemplateEnginePlugin() tmpl = plugin.load_template(PACKAGE + '.templates.functions') output = plugin.render({}, template=tmpl) self.assertEqual("""False bar """, output)
def test_init_with_new_syntax(self): plugin = TextTemplateEnginePlugin(options={ 'genshi.new_text_syntax': 'yes', }) self.assertEqual(NewTextTemplate, plugin.template_class) tmpl = plugin.load_template(PACKAGE + '.templates.new_syntax') output = plugin.render({'foo': True}, template=tmpl) self.assertEqual('bar', output)
def test_render(self): plugin = TextTemplateEnginePlugin() tmpl = plugin.load_template(PACKAGE + '.templates.test') output = plugin.render({'message': 'Hello'}, template=tmpl) self.assertEqual("""Test ==== Hello """, output)