def METHOD_NAME(query, require_all_on, expected):
    df = pd.DataFrame(
        {
            'A': ['NCAR', 'IPSL', 'IPSL', 'CSIRO', 'IPSL', 'NCAR', 'NOAA', 'NCAR', 'NASA', None],
            'B': ['CESM', 'FOO', 'FOO', 'BAR', 'FOO', 'CESM', 'GCM', 'WACM', 'foo', None],
            'C': [
                'hist',
                'control',
                'hist',
                'control',
                'hist',
                'control',
                'hist',
                'hist',
                'HiSt',
                'exp',
            ],
            'D': ['O2', 'O2', 'O2', 'O2', 'NO2', 'O2', 'O2', 'TA', 'tAs', 'UA'],
        }
    )
    query_model = QueryModel(
        query=query, columns=df.columns.tolist(), require_all_on=require_all_on
    )
    results = search(df=df, query=query_model.query, columns_with_iterables=set())
    assert isinstance(results, pd.DataFrame)
    if require_all_on:
        results = search_apply_require_all_on(
            df=results, query=query_model.query, require_all_on=query_model.require_all_on
        )
    assert results.to_dict(orient='records') == expected