Skip to content

Commit

Permalink
test sql_header w jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 13, 2023
1 parent 40d6db1 commit d77bfe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/functional/show/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

models__sql_header = """
{% call set_sql_header(config) %}
set session time zone 'Asia/Kolkata';
set session time zone '{{ var("timezone", "Europe/Paris") }}';
{%- endcall %}
select current_setting('timezone') as timezone
"""
Expand Down
7 changes: 4 additions & 3 deletions tests/functional/show/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ def test_seed(self, project):

class TestShowSqlHeader(ShowBase):
def test_sql_header(self, project):
run_dbt(["build"])
(_, log_output) = run_dbt_and_capture(["show", "--select", "sql_header"])
assert "Asia/Kolkata" in log_output
run_dbt(["build", "--vars", "timezone: Asia/Kolkata"])
(_, log_output) = run_dbt_and_capture(
["show", "--select", "sql_header", "--vars", "timezone: Asia/Kolkata"]
)


class TestShowModelVersions:
Expand Down

0 comments on commit d77bfe2

Please sign in to comment.