Skip to content

Commit

Permalink
Merge branch 'dev/grace-kelly' into feature/hook-config-aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Nov 23, 2018
2 parents 0307d78 + f72e0a8 commit 71a2398
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/clients/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __call__(self, *args, **kwargs):

def get_environment(node=None, capture_macros=False):
args = {
'extensions': []
'extensions': ['jinja2.ext.do']
}

if capture_macros:
Expand Down
11 changes: 11 additions & 0 deletions test/unit/test_jinja.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import unittest

from dbt.clients.jinja import get_template

class TestJinja(unittest.TestCase):
def test_do(self):
s = '{% set my_dict = {} %}\n{% do my_dict.update(a=1) %}'

template = get_template(s, {})
mod = template.make_module()
self.assertEqual(mod.my_dict, {'a': 1})

0 comments on commit 71a2398

Please sign in to comment.