{% test at_least_one_null(model, columns) %} select * from {{ model }} where {% for column in columns %} {{ column }} is not null {% if not loop.last %} and {% endif %} {% endfor %} -- If all columns are not null, the row violates the test {% endtest %}