From a8ac3f85bd9a3b33a8d8e9aee95b7634866d512d Mon Sep 17 00:00:00 2001 From: Berit Date: Thu, 26 Oct 2023 10:33:59 +0200 Subject: [PATCH] Update backend/download/tests/test_download_views.py Co-authored-by: Luka van der Plas <43678097+lukavdplas@users.noreply.github.com> --- backend/download/tests/test_download_views.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/backend/download/tests/test_download_views.py b/backend/download/tests/test_download_views.py index aeb81dc2b..cfecb1aa9 100644 --- a/backend/download/tests/test_download_views.py +++ b/backend/download/tests/test_download_views.py @@ -81,21 +81,10 @@ def ngram_parameters(mock_corpus, mock_corpus_specs): } def mock_es_query(query_text, search_field): - return { - "query": { - "bool": { - "must": { - "simple_query_string": { - "query": query_text, - "fields": [search_field], - "lenient": True, - "default_operator": "or" - } - }, - "filter": [] - } - } - } + q = query.MATCH_ALL + q = query.set_query_text(q, query_text) + q = query.set_search_fields(q, [search_field]) + return q @pytest.mark.parametrize("visualization_type, request_parameters", [('date_term_frequency', term_frequency_parameters), ('ngram', ngram_parameters)]) def test_full_data_download_view(transactional_db, admin_client, small_mock_corpus,