{% test latest_date_is_yesterday(model, column_name) %} with model_max_date as ( select max({{ column_name }}) as max_date from {{ model }} ) select * from model_max_date where max_date <> current_date - 1 {% endtest %}