예제 #1
0
    def test_given_list_of_columns_then_returns_all_columns_for_searching(self):
        table = Mock()
        column1 = Mock()
        column2 = Mock()

        config = SearchConfig(table=table,
                              columns={'column1': column1, 'column2': column2},
                              default_sort='column1')

        result = config.columns_for_searching()

        assert_that(result, contains(column1, column2))
예제 #2
0
    def test_given_list_of_search_columns_then_returns_only_columns_for_searching(self):
        table = Mock()
        column = Mock()

        config = SearchConfig(table=table,
                              columns={'column1': column, 'column2': Mock()},
                              search=['column1'],
                              default_sort='column1')

        result = config.columns_for_searching()

        assert_that(result, contains(column))
예제 #3
0
    def test_given_list_of_columns_then_returns_all_columns_for_searching(
            self):
        table = Mock()
        column1 = Mock()
        column2 = Mock()

        config = SearchConfig(table=table,
                              columns={
                                  'column1': column1,
                                  'column2': column2
                              },
                              default_sort='column1')

        result = config.columns_for_searching()

        assert_that(result, contains(column1, column2))
예제 #4
0
    def test_given_list_of_search_columns_then_returns_only_columns_for_searching(
            self):
        table = Mock()
        column = Mock()

        config = SearchConfig(table=table,
                              columns={
                                  'column1': column,
                                  'column2': Mock()
                              },
                              search=['column1'],
                              default_sort='column1')

        result = config.columns_for_searching()

        assert_that(result, contains(column))