From 3abb353a554603b11ec89cc229c1c1c46291e7aa Mon Sep 17 00:00:00 2001 From: ffont Date: Fri, 2 Feb 2024 14:50:41 +0100 Subject: [PATCH] Fix failing test --- utils/tests/test_search_general.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/utils/tests/test_search_general.py b/utils/tests/test_search_general.py index 7ebd973f4..6f253612d 100644 --- a/utils/tests/test_search_general.py +++ b/utils/tests/test_search_general.py @@ -39,7 +39,7 @@ def test_search_prepare_parameters_without_query_params(self): AuthenticationMiddleware().process_request(request) request.session.save() query_params, advanced_search_params_dict, extra_vars = search_prepare_parameters(request) - + expected_default_query_params = { 'query_fields': settings.SEARCH_SOUNDS_DEFAULT_FIELD_WEIGHTS, 'sort': settings.SEARCH_SOUNDS_SORT_OPTION_DATE_NEW_FIRST, @@ -50,6 +50,17 @@ def test_search_prepare_parameters_without_query_params(self): 'textual_query': '', 'similar_to': None, 'only_sounds_with_pack': False, + 'only_sounds_within_ids': [], + 'facets': {'bitdepth': {}, + 'bitrate': {}, + 'channels': {}, + 'license': {'limit': 10}, + 'pack_grouping': {'limit': 10}, + 'samplerate': {}, + 'tags': {'limit': 30}, + 'type': {'limit': 7}, + 'username': {'limit': 30} + }, } expected_extra_vars = { @@ -75,7 +86,6 @@ def test_search_prepare_parameters_with_query_params(self): AuthenticationMiddleware().process_request(request) request.session.save() query_params, advanced_search_params_dict, extra_vars = search_prepare_parameters(request) - expected_default_query_params = { 'query_fields': { settings.SEARCH_SOUNDS_FIELD_ID: 0, @@ -95,6 +105,17 @@ def test_search_prepare_parameters_with_query_params(self): 'textual_query': 'dog', 'similar_to': None, 'only_sounds_with_pack': False, + 'only_sounds_within_ids': [], + 'facets': {'bitdepth': {}, + 'bitrate': {}, + 'channels': {}, + 'license': {'limit': 10}, + 'pack_grouping': {'limit': 10}, + 'samplerate': {}, + 'tags': {'limit': 30}, + 'type': {'limit': 7}, + 'username': {'limit': 30} + }, } expected_extra_vars = { @@ -105,7 +126,7 @@ def test_search_prepare_parameters_with_query_params(self): 'has_facet_filter': False, 'parsed_filters': [['duration', ':', '[', '1', ' TO ', '10', ']'], ['is_geotagged', ':', '1']], 'parsing_error': False, - 'raw_weights_parameter': '' + 'raw_weights_parameter': '', } expected_advanced_search_params_dict = {