def test_render_func(self, default_envs): assert TemplateLiquid('{{x | render}}', **default_envs).render({'x': '{{i}}', 'i': 2}) == '2' assert TemplateLiquid('{{x | render}}', **default_envs).render({'x': [], 'i': 2}) == '[]' liquid = TemplateLiquid('{{x | render}}', **default_envs) with pytest.raises(LiquidRenderError): liquid.render({'x': '', '__engine': None})
def testRender(self, source, data, out): tpl = TemplateLiquid(source) assert tpl.render(data) == out
def testRender(self, source, data, out, default_envs): tpl = TemplateLiquid(source, **default_envs) assert tpl.render(data) == out
def testRender(self, source, data, out): tpl = TemplateLiquid(source) helpers.assertTextEqual(self, tpl.render(data), out)