(self)
| 110 | self.assertEqual(template.generate(upper=upper), utf8("FOO \u00c9")) |
| 111 | |
| 112 | def test_bytes_apply(self): |
| 113 | def upper(s): |
| 114 | return utf8(to_unicode(s).upper()) |
| 115 | |
| 116 | template = Template(utf8("{% apply upper %}foo \u00e9{% end %}")) |
| 117 | self.assertEqual(template.generate(upper=upper), utf8("FOO \u00c9")) |
| 118 | |
| 119 | def test_if(self): |
| 120 | template = Template(utf8("{% if x > 4 %}yes{% else %}no{% end %}")) |