Lines Matching refs:env
13 def test_assigned_scoping(self, env): argument
14 t = env.from_string(
24 t = env.from_string(
35 t = env.from_string(
46 def test_closure_scoping(self, env): argument
47 t = env.from_string(
59 t = env.from_string(
71 t = env.from_string(
84 def test_keyword_folding(self, env): argument
85 env = Environment()
86 env.filters["testing"] = lambda value, some: value + some
88 env.from_string("{{ 'test'|testing(some='stuff') }}").render()
92 def test_extends_output_bugs(self, env): argument
93 env = Environment(
97 t = env.from_string(
105 def test_urlize_filter_escaping(self, env): argument
106 tmpl = env.from_string('{{ "http://www.example.org/<foo"|urlize }}')
112 def test_loop_call_loop(self, env): argument
113 tmpl = env.from_string(
133 def test_weird_inline_comment(self, env): argument
134 env = Environment(line_statement_prefix="%")
137 env.from_string,
141 def test_old_macro_loop_scoping_bug(self, env): argument
142 tmpl = env.from_string(
148 def test_partial_conditional_assignments(self, env): argument
149 tmpl = env.from_string("{% if b %}{% set a = 42 %}{% endif %}{{ a }}")
153 def test_stacked_locals_scoping_bug(self, env): argument
154 env = Environment(line_statement_prefix="#")
155 t = env.from_string(
179 def test_stacked_locals_scoping_bug_twoframe(self, env): argument
194 def test_call_with_args(self, env): argument
235 def test_empty_if_condition_fails(self, env): argument
242 def test_recursive_loop_compile(self, env): argument
272 def test_else_loop_bug(self, env): argument
284 def test_correct_prefix_loader_name(self, env): argument
285 env = Environment(loader=PrefixLoader({"foo": DictLoader({})}))
287 env.get_template("foo/bar.html")
291 def test_contextfunction_callable_classes(self, env): argument
306 env = Environment(
309 t = env.from_string('{% extends "main" %}{% set x %}42{% endset %}')
312 def test_nested_for_else(self, env): argument
313 tmpl = env.from_string(
320 def test_macro_var_bug(self, env): argument
321 tmpl = env.from_string(
331 def test_macro_var_bug_advanced(self, env): argument
332 tmpl = env.from_string(
345 env = Environment()
346 env.globals["get_int"] = lambda: 42
347 t = env.from_string(
358 env = Environment(
363 assert env.from_string(template).render()
365 def test_macro_scoping(self, env): argument
366 tmpl = env.from_string(
384 env = Environment(
405 a = env.get_template("a.html")
406 b = env.get_template("b.html")
407 c = env.get_template("c.html")
414 env = Environment(
423 t = env.get_template("child.html")
426 def test_caller_scoping(self, env): argument
427 t = env.from_string(
453 def test_variable_reuse(self, env): argument
454 t = env.from_string("{% for x in x.y %}{{ x }}{% endfor %}")
457 t = env.from_string("{% for x in x.y %}{{ loop.index0 }}|{{ x }}{% endfor %}")
460 t = env.from_string("{% for x in x.y recursive %}{{ x }}{% endfor %}")
463 def test_double_caller(self, env): argument
464 t = env.from_string(
471 def test_double_caller_no_default(self, env): argument
473 env.from_string(
481 t = env.from_string(
491 def test_macro_blocks(self, env): argument
492 t = env.from_string(
497 def test_scoped_block(self, env): argument
498 t = env.from_string(
504 def test_recursive_loop_filter(self, env): argument
505 t = env.from_string(
529 def test_empty_if(self, env): argument
530 t = env.from_string("{% if foo %}{% else %}42{% endif %}")
533 def test_subproperty_if(self, env): argument
534 t = env.from_string(
545 env = Environment(
553 assert env.get_template("main").render() == "foobar"
556 env = Environment(
564 assert env.get_template("main").render() == "123"
575 def test_custom_context(self, env): argument
585 env = MyEnvironment(loader=loader)
586 assert env.get_template("test").render(foobar="test") == "test"
588 def test_legacy_custom_context(self, env): argument
597 x = MyContext(env, parent={"bar": 23}, name="foo", blocks={})
603 def test_recursive_loop_bug(self, env): argument
604 tmpl = env.from_string(