Exemplo n.º 1
0
    def setUp(self):
        config = Config()
        config.options = {
            "jinja": {
                "template": "foo",
            }
        }

        self.entity = Entity(config)

        site = Site()
        site.entities.append(self.entity)

        self.render = Render(site, config)
Exemplo n.º 2
0
class TestRender(unittest.TestCase):
    def setUp(self):
        config = Config()
        config.options = {
            "jinja": {
                "template": "foo",
            }
        }

        self.entity = Entity(config)

        site = Site()
        site.entities.append(self.entity)

        self.render = Render(site, config)

    def test_run_skips_empty_layout(self):
        """should not raise an exception - ignore entity"""
        self.render.run()

    def test_template_not_found(self):
        """should raise TemplateNotFound exception"""
        self.entity.meta["layout"] = "foo"
        self.assertRaises(TemplateNotFound, self.render.run)