# Append it as the most recent scope and render
new_scope = [thing] + scopes
rend = render(template=tags, scopes=new_scope,
+ padding=padding,
partials_path=partials_path,
partials_ext=partials_ext,
partials_dict=partials_dict,
self.assertEqual(result, expected)
+ def test_iterator_scope_indentation(self):
+ args = {
+ 'data': {
+ 'thing': ['foo', 'bar', 'baz'],
+ },
+ 'template': '{{> count }}',
+ 'partials_dict': {
+ 'count': ' {{> iter_scope }}',
+ 'iter_scope': 'foobar\n{{#thing}}\n {{.}}\n{{/thing}}'
+ }
+ }
+
+ result = chevron.render(**args)
+ expected = ' foobar\n foo\n bar\n baz\n'
+
+ self.assertEqual(result, expected)
+
# Run unit tests from command line
if __name__ == "__main__":