]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Moved with test to coretags
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 8 Jan 2017 13:20:55 +0000 (14:20 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 8 Jan 2017 13:20:55 +0000 (14:20 +0100)
tests/test_core_tags.py
tests/test_ext.py

index 9f0cabfb2bbfa5ce1be9e4670ff6eab472b369a9..edbcad6eb9bc077112251938f75e72866977fb9d 100644 (file)
@@ -363,3 +363,19 @@ class TestSet(object):
         tmpl = env.from_string('{% set foo %}<em>{{ test }}</em>'
                                '{% endset %}foo: {{ foo }}')
         assert tmpl.render(test='<unsafe>') == 'foo: <em>&lt;unsafe&gt;</em>'
+
+
+@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']
index 79f783066ea8886213f9ae6e8340d6928f1aa9a0..9f8b9c3a65bce4e87c581cde6060728622b51c82 100644 (file)
@@ -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 %}')