Misc test fixes

This commit is contained in:
Phill Ridout 2017-11-03 22:52:24 +00:00
parent e9eb838c3f
commit f307568cbb
7 changed files with 7 additions and 5 deletions

View File

@ -366,6 +366,7 @@ class ActionList(object):
continue continue
if existing_action in affected_actions: if existing_action in affected_actions:
return False return False
print(existing_action.shortcutContext())
if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
return False return False
elif action in self.get_all_child_objects(existing_action.parent()): elif action in self.get_all_child_objects(existing_action.parent()):

View File

@ -719,7 +719,7 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
'OpenLP Service Files (*.osz);; OpenLP Service Files - lite (*.oszl)')) 'OpenLP Service Files (*.osz);; OpenLP Service Files - lite (*.oszl)'))
else: else:
file_path, filter_used = FileDialog.getSaveFileName( file_path, filter_used = FileDialog.getSaveFileName(
self.main_window, UiStrings().SaveService, file_path, self.main_window, UiStrings().SaveService, default_file_path,
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz);;')) translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz);;'))
if not file_path: if not file_path:
return False return False

View File

@ -153,6 +153,7 @@ class TestActionList(TestCase, TestMixin):
""" """
Prepare the tests Prepare the tests
""" """
self.setup_application()
self.action_list = ActionList.get_instance() self.action_list = ActionList.get_instance()
self.build_settings() self.build_settings()
self.settings = Settings() self.settings = Settings()

View File

@ -155,7 +155,7 @@ def test_check_same_instance():
assert first_instance is second_instance, 'Two UiStrings objects should be the same instance' assert first_instance is second_instance, 'Two UiStrings objects should be the same instance'
def test_translate(self): def test_translate():
""" """
Test the translate() function Test the translate() function
""" """

View File

@ -42,8 +42,8 @@ class TestProjectorManager(TestCase, TestMixin):
""" """
Create the UI and setup necessary options Create the UI and setup necessary options
""" """
self.build_settings()
self.setup_application() self.setup_application()
self.build_settings()
Registry.create() Registry.create()
with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url:
if os.path.exists(TEST_DB): if os.path.exists(TEST_DB):

View File

@ -64,8 +64,8 @@ class ProjectorSourceFormTest(TestCase, TestMixin):
Set up anything necessary for all tests Set up anything necessary for all tests
""" """
mocked_init_url.return_value = 'sqlite:///{}'.format(TEST_DB) mocked_init_url.return_value = 'sqlite:///{}'.format(TEST_DB)
self.build_settings()
self.setup_application() self.setup_application()
self.build_settings()
Registry.create() Registry.create()
# Do not try to recreate if we've already been created from a previous test # Do not try to recreate if we've already been created from a previous test
if not hasattr(self, 'projectordb'): if not hasattr(self, 'projectordb'):

View File

@ -41,8 +41,8 @@ class TestThemeManager(TestCase, TestMixin):
""" """
Create the UI Create the UI
""" """
self.build_settings()
self.setup_application() self.setup_application()
self.build_settings()
Registry.create() Registry.create()
self.theme_manager = ThemeManager() self.theme_manager = ThemeManager()