Exemple #1
0
    def test_renders_default(self):
        """Test rendering a default template."""
        content = '<html>${title}${content}</html>\n'
        with open(os.path.join(self.site_path, 'template.html'), 'w') as f:
            f.write(content)

        catalog = self._make_one()
        template = catalog.default
        self.assertEqual(template.render({'title': 'foo', 'content': 'bar'}),
                         '<html>foobar</html>\n')
Exemple #2
0
 def test_render_not_implemented(self):
     from handroll.template.catalog import Template
     template = Template()
     with self.assertRaises(NotImplementedError):
         template.render({})