Example #1
0
	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})
Example #2
0
	def testRender(self, source, data, out):
		tpl = TemplateLiquid(source)
		assert tpl.render(data) == out
Example #3
0
	def testRender(self, source, data, out, default_envs):
		tpl = TemplateLiquid(source, **default_envs)
		assert tpl.render(data) == out
Example #4
0
	def testRender(self, source, data, out):
		tpl = TemplateLiquid(source)
		helpers.assertTextEqual(self, tpl.render(data), out)