(self)
| 350 | assert tmpl.render().strip() == "0123456789" |
| 351 | |
| 352 | def test_callable_defaults(self): |
| 353 | env = Environment() |
| 354 | env.globals["get_int"] = lambda: 42 |
| 355 | t = env.from_string( |
| 356 | """ |
| 357 | {% macro test(a, b, c=get_int()) -%} |
| 358 | {{ a + b + c }} |
| 359 | {%- endmacro %} |
| 360 | {{ test(1, 2) }}|{{ test(1, 2, 3) }} |
| 361 | """ |
| 362 | ) |
| 363 | assert t.render().strip() == "45|6" |
| 364 | |
| 365 | def test_macro_escaping(self): |
| 366 | env = Environment(autoescape=lambda x: False) |
nothing calls this directly
no test coverage detected