@pytest.mark.parametrize('es_filter_fields, query_params, expected', [([ESFieldFilter('score')], {'from_score': '500'}, [6, 7, 8, 10, 11]), ([ESFieldFilter('score')], {'to_score': '100'}, [1, 3, 5, 9, 12, 14]), ([ESFieldFilter('score')], {'from_score': '500', 'to_score': '600'}, [7, 8, 10]), ([ESFieldFilter('score')], {}, [int(item['_id']) for item in DATA])])
def test_filter_search(self, search, es_filter_fields, query_params, expected):
    view = self.create_view(es_filter_fields)
    request = rf.get('/test/')
    request.query_params = query_params
    search = self.backend.filter_search(request, search, view)
    result = get_search_ids(search)
    assert (sorted(result) == sorted(expected))
@pytest.mark.parametrize('es_filter_fields, query_params, expected', [([ESFieldFilter('score')], {'from_score': '500'}, [6, 7, 8, 10, 11]), ([ESFieldFilter('score')], {'to_score': '100'}, [1, 3, 5, 9, 12, 14]), ([ESFieldFilter('score')], {'from_score': '500', 'to_score': '600'}, [7, 8, 10]), ([ESFieldFilter('score')], {}, [int(item['_id']) for item in DATA])])
def test_filter_search(self, search, es_filter_fields, query_params, expected):
    view = self.create_view(es_filter_fields)
    request = rf.get('/test/')
    request.query_params = query_params
    search = self.backend.filter_search(request, search, view)
    result = get_search_ids(search)
    assert (sorted(result) == sorted(expected))