]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Added regression test for slicing of attributes
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 30 Jan 2020 17:16:38 +0000 (18:16 +0100)
committerDavid Lord <davidism@gmail.com>
Thu, 30 Jan 2020 17:40:14 +0000 (09:40 -0800)
tests/test_async.py

index f7e27922ea84773c1f2d13a615e00b2f7442fe6d..d6c4a239aa20a6d32d246c75e502f525d65d29fe 100644 (file)
@@ -579,3 +579,7 @@ class TestAsyncForLoop(object):
     def test_bare_async(self, test_env_async):
         t = test_env_async.from_string('{% extends "header" %}')
         assert t.render(foo=42) == "[42|23]"
+
+    def test_awaitable_property_slicing(self, test_env_async):
+        t = test_env_async.from_string("{% for x in a.b[:1] %}{{ x }}{% endfor %}")
+        assert t.render(a=dict(b=[1, 2, 3])) == "1"