From: Armin Ronacher Date: Sun, 8 Jan 2017 13:20:55 +0000 (+0100) Subject: Moved with test to coretags X-Git-Tag: 2.9.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e2572b5c8bcb82ee4ba44c212c90900c33dd92;p=thirdparty%2Fjinja.git Moved with test to coretags --- diff --git a/tests/test_core_tags.py b/tests/test_core_tags.py index 9f0cabfb..edbcad6e 100644 --- a/tests/test_core_tags.py +++ b/tests/test_core_tags.py @@ -363,3 +363,19 @@ class TestSet(object): tmpl = env.from_string('{% set foo %}{{ test }}' '{% endset %}foo: {{ foo }}') assert tmpl.render(test='') == 'foo: <unsafe>' + + +@pytest.mark.core_tags +@pytest.mark.with_ +class TestWith(object): + + def test_with(self): + env = Environment(extensions=['jinja2.ext.with_']) + tmpl = env.from_string('''\ + {% with a=42, b=23 -%} + {{ a }} = {{ b }} + {% endwith -%} + {{ a }} = {{ b }}\ + ''') + assert [x.strip() for x in tmpl.render(a=1, b=2).splitlines()] \ + == ['42 = 23', '1 = 2'] diff --git a/tests/test_ext.py b/tests/test_ext.py index 79f78306..9f8b9c3a 100644 --- a/tests/test_ext.py +++ b/tests/test_ext.py @@ -195,17 +195,6 @@ class TestExtensions(object): {%- endfor %}{{ items|join(', ') }}''') assert tmpl.render() == '0f, 1o, 2o' - def test_with(self): - env = Environment(extensions=['jinja2.ext.with_']) - tmpl = env.from_string('''\ - {% with a=42, b=23 -%} - {{ a }} = {{ b }} - {% endwith -%} - {{ a }} = {{ b }}\ - ''') - assert [x.strip() for x in tmpl.render(a=1, b=2).splitlines()] \ - == ['42 = 23', '1 = 2'] - def test_extension_nodes(self): env = Environment(extensions=[ExampleExtension]) tmpl = env.from_string('{% test %}')