From the documentation it’s not clear if we can mock reference to the model we are testing.
Example if my model is
select * from my_model
{% if is_incremental() -%}
and _current_dbt_refreshed_at > (select max(_parent_dbt_refreshed_at) from {{ this }})
{%- endif %}
It’s not clear if we can use unit test given feature to mock reference to {{this}}
unit_tests:
- name: incremental_logic_only_new
model: my_cool_model
overrides:
macros:
# unit test this model in "full refresh" mode
is_incremental: true
given:
- input: this / my_cool_model
rows:
- {col1: test, col2: test2}