Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Feb 2, 2024
1 parent f109ab7 commit 3abb353
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions utils/tests/test_search_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {
Expand All @@ -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,
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand Down

0 comments on commit 3abb353

Please sign in to comment.