new preferences handling

Preferences class was introduced in order to handle user preferences. Right now
it parses cookies and the form in preferences. Also it can retrieve settings
based on the name of the setting.

ATTENTION
Please note that engine preferences are handled differently from now on. So it
introduces incompatible changes. Every user who has saved preferences should reset and
save his/her settings again.

This change was needed, because everytime a default disabled engine was
added saved user preferences would broke. Now engine setting tracking is
fixed.
This commit is contained in:
Noemi Vanyi 2016-04-08 16:38:05 +02:00
parent 9331fc28a8
commit fe691a0988
6 changed files with 315 additions and 167 deletions

View file

@ -12,7 +12,6 @@ class ViewsTestCase(SearxTestCase):
def setUp(self):
webapp.app.config['TESTING'] = True # to get better error messages
self.app = webapp.app.test_client()
webapp.default_theme = 'default'
# set some defaults
self.test_results = [
@ -43,6 +42,11 @@ class ViewsTestCase(SearxTestCase):
webapp.Search.search = search_mock
def get_current_theme_name_mock(override=None):
return 'default'
webapp.get_current_theme_name = get_current_theme_name_mock
self.maxDiff = None # to see full diffs
def test_index_empty(self):