searx: Preserve public_access setting

- Preserve the setting during enable/disable as well as during backup/restore.
- Show setting as disabled when application is disabled but restore user's
  original preference value on enable.
- Add functional test for this.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati authored and James Valleroy committed 2019-06-09 10:40:49 -04:00
1 parent 2d85b61199
commit 7e1e5182cc
8 files changed
+46 -14

No files matched your search

+9
View File
@@ -53,3 +53,12 @@ Scenario: Disable public access
Then searx app should not be visible on the front page
And the searx site should not be available
Scenario: Preserve public access setting
Given the searx application is enabled
And I enable public access in searx
When I disable the searx application
And I enable the searx application
And I log out
Then searx app should be visible on the front page
And the searx site should be available
@@ -443,6 +443,6 @@ def app_visible_on_front_page(browser, app_name):
@then(
parsers.parse('{app_name:w} app should not be visible on the front page'))
def app_visible_on_front_page(browser, app_name):
def app_not_visible_on_front_page(browser, app_name):
shortcuts = application.find_on_front_page(browser, app_name)
assert len(shortcuts) == 0
@@ -29,6 +29,7 @@ def logged_in_user(browser):
config['DEFAULT']['password'])
@when("I log out")
@given("I'm a logged out user")
def logged_out_user(browser):
browser.visit(default_url + '/plinth/accounts/logout/')