def test_3():
    """
    This test checks the formulas for the LESS THAN filter
    """
    table = pandas.read_csv('data/data_for_test_insert_as_column/test_2.csv')

    cheader_to_clabel = {}
    cheader_to_clabel['Student Name'] = 'A'
    cheader_to_clabel['Marks'] = 'B'
    cheader_to_clabel['Date of Test'] = 'C'

    row_start_label = 2
    row_end_label = 8

    column_start_label = 'A'
    column_end_label = 'C'

    slice_condition = ('Marks', enums.Filters.LESS_THAN, 70)
    slices = [slice_condition]

    list_of_formulas = insert_as_column.insert_as_column_show(
        table,
        cheader_to_clabel,
        row_start_label,
        row_end_label,
        column_start_label,
        column_end_label,
        slices=slices)

    for formula in list_of_formulas:
        print(formula)

    expected_list_of_formulas = "['=NOT(ISNA(QUERY(A2:C2, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A3:C3, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A4:C4, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A5:C5, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A6:C6, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A7:C7, \"select A where (B<70)\")))', '=NOT(ISNA(QUERY(A8:C8, \"select A where (B<70)\")))']"

    assert (expected_list_of_formulas == str(list_of_formulas))
def test_6():
    """
    This test checks the formulas for date range filter
    """
    table = pandas.read_csv('data/data_for_test_insert_as_column/test_5.csv')

    cheader_to_clabel = {}
    cheader_to_clabel['Student Name'] = 'A'
    cheader_to_clabel['Score'] = 'B'
    cheader_to_clabel['Date of Test'] = 'C'

    row_start_label = 2
    row_end_label = 8

    column_start_label = 'A'
    column_end_label = 'C'

    slices = []

    date_column_name = 'Date of Test'
    date_range = ('2019-01-21', '2019-01-24')

    list_of_formulas = insert_as_column.insert_as_column_show(
        table,
        cheader_to_clabel,
        row_start_label,
        row_end_label,
        column_start_label,
        column_end_label,
        slices=slices,
        date_column_name=date_column_name,
        date_range=date_range)

    for formula in list_of_formulas:
        print(formula)

    expected_list_of_formulas = "['=NOT(ISNA(QUERY(A2:C2, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A3:C3, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A4:C4, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A5:C5, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A6:C6, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A7:C7, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))', '=NOT(ISNA(QUERY(A8:C8, \"select A where (C >= date \\'2019-01-21\\' and C <= date \\'2019-01-24\\')\")))']"

    assert (expected_list_of_formulas == str(list_of_formulas))