def test_custom_tests(self):
        """Templates: jinja2 custom tests """
        from bottle import jinja2_template as template
        TEMPL = touni("{% if var is even %}gerade{% else %}ungerade{% endif %}")
        settings = dict(tests={"even": lambda x: False if x % 2 else True})
        t = Jinja2Template(TEMPL, **settings)
        self.assertEqual("gerade", t.render(var=2))
        self.assertEqual("ungerade", t.render(var=1))
dataset/ETHPy150Open bottlepy/bottle/test/test_jinja2.py/TestJinja2Template.test_custom_tests/original