diff options
author | Alexandre Flament <alex@al-f.net> | 2022-05-07 15:11:05 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2022-05-07 19:40:48 +0200 |
commit | 9b3efa6d8ab46a3db62f42624d7e9f4b55fdd0ef (patch) | |
tree | 554ff67c6b84531b2a6f99505cc954395d730024 /tests/unit/test_webapp.py | |
parent | 6db568bf69b7145451ff90e14da0e49fb5b6269b (diff) | |
download | searxng-9b3efa6d8ab46a3db62f42624d7e9f4b55fdd0ef.tar.gz searxng-9b3efa6d8ab46a3db62f42624d7e9f4b55fdd0ef.zip |
theme: remove __common__
Diffstat (limited to 'tests/unit/test_webapp.py')
-rw-r--r-- | tests/unit/test_webapp.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index bb09e591e..558cc6bb3 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -7,6 +7,7 @@ from searx.results import Timing import searx.search.processors from searx.search import Search +from searx.preferences import Preferences from tests import SearxTestCase @@ -77,12 +78,14 @@ class ViewsTestCase(SearxTestCase): self.setattr4test(Search, 'search', search_mock) - def get_current_theme_name_mock(override=None): - if override: - return override - return 'simple' + original_preferences_get_value = Preferences.get_value - self.setattr4test(webapp, 'get_current_theme_name', get_current_theme_name_mock) + def preferences_get_value(preferences_self, user_setting_name: str): + if user_setting_name == 'theme': + return 'simple' + return original_preferences_get_value(preferences_self, user_setting_name) + + self.setattr4test(Preferences, 'get_value', preferences_get_value) self.maxDiff = None # to see full diffs |