diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 6fe0429cb..830994546 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -275,9 +275,6 @@ class Settings(QtCore.QSettings): ('songuasge/db hostname', 'songusage/db hostname', []), ('songuasge/db database', 'songusage/db database', []), ('presentations / Powerpoint Viewer', '', []), - ('songuasge/db hostname', 'songusage/db hostname', []), - ('songuasge/db hostname', 'songusage/db hostname', []), - ('songuasge/db hostname', 'songusage/db hostname', []), ('bibles/proxy name', '', []), # Just remove these bible proxy settings. They weren't used in 2.4! ('bibles/proxy address', '', []), ('bibles/proxy username', '', []), diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 0111c13e5..e15f81ab6 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -609,4 +609,4 @@ def create_separated_list(string_list): last=string_list[-1]) else: list_to_string = '' - return list_to_string \ No newline at end of file + return list_to_string diff --git a/openlp/plugins/bibles/lib/upgrade.py b/openlp/plugins/bibles/lib/upgrade.py index 76fa49ca0..763e40c6b 100644 --- a/openlp/plugins/bibles/lib/upgrade.py +++ b/openlp/plugins/bibles/lib/upgrade.py @@ -51,7 +51,6 @@ def upgrade_2(session, metadata): Remove the individual proxy settings, after the implementation of central proxy settings. Added in 2.5 (3.0 development) """ - # TODO: Test settings = Settings() op = get_upgrade_op(session) metadata_table = Table('metadata', metadata, autoload=True) @@ -80,7 +79,8 @@ def upgrade_2(session, metadata): https_proxy = proxy settings.setValue('advanced/proxy https', proxy) if http_proxy or https_proxy: - username, = session.execute(select([metadata_table.c.value], metadata_table.c.key == 'proxy_username')).first() + username, = session.execute( + select([metadata_table.c.value], metadata_table.c.key == 'proxy_username')).first() proxy, = session.execute(select([metadata_table.c.value], metadata_table.c.key == 'proxy_password')).first() settings.setValue('advanced/proxy username', username) settings.setValue('advanced/proxy password', proxy) diff --git a/tests/functional/openlp_core/common/test_i18n.py b/tests/functional/openlp_core/common/test_i18n.py index 7dadcb976..a4b896c6b 100644 --- a/tests/functional/openlp_core/common/test_i18n.py +++ b/tests/functional/openlp_core/common/test_i18n.py @@ -162,6 +162,7 @@ def test_check_same_instance(): def test_get_language_from_settings(): assert LanguageManager.get_language() == 'en' + def test_get_language_from_settings_returns_unchanged_if_unknown_format(): Settings().setValue('core/language', '(foobar)') assert LanguageManager.get_language() == '(foobar)' diff --git a/tests/functional/openlp_plugins/bibles/test_upgrade.py b/tests/functional/openlp_plugins/bibles/test_upgrade.py index 0eb33338d..1e2520391 100644 --- a/tests/functional/openlp_plugins/bibles/test_upgrade.py +++ b/tests/functional/openlp_plugins/bibles/test_upgrade.py @@ -146,7 +146,6 @@ class TestProxyMetaUpgrade(TestCase, TestMixin): assert conn.execute('SELECT * FROM metadata WHERE key = "version"').first().value == '2' self.mocked_settings_instance.setValue.assert_not_called() - def test_upgrade_2_http_selected(self): """ Test that upgrade 2 completes properly when the user chooses to use a HTTP proxy @@ -167,7 +166,7 @@ class TestProxyMetaUpgrade(TestCase, TestMixin): assert conn.execute('SELECT * FROM metadata WHERE key = "version"').first().value == '2' assert self.mocked_settings_instance.setValue.call_args_list == [ - call('advanced/proxy http', 'proxy_server'), call('advanced/proxy username', 'proxy_username'), + call('advanced/proxy http', 'proxy_server'), call('advanced/proxy username', 'proxy_username'), call('advanced/proxy password', 'proxy_password'), call('advanced/proxy mode', ProxyMode.MANUAL_PROXY)] def test_upgrade_2_https_selected(self): @@ -214,6 +213,6 @@ class TestProxyMetaUpgrade(TestCase, TestMixin): assert conn.execute('SELECT * FROM metadata WHERE key = "version"').first().value == '2' assert self.mocked_settings_instance.setValue.call_args_list == [ - call('advanced/proxy http', 'proxy_server'), call('advanced/proxy https', 'proxy_server'), - call('advanced/proxy username', 'proxy_username'), call('advanced/proxy password', 'proxy_password'), - call('advanced/proxy mode', ProxyMode.MANUAL_PROXY)] + call('advanced/proxy http', 'proxy_server'), call('advanced/proxy https', 'proxy_server'), + call('advanced/proxy username', 'proxy_username'), call('advanced/proxy password', 'proxy_password'), + call('advanced/proxy mode', ProxyMode.MANUAL_PROXY)]