From 2e9f274027ff3f732631b531e60245a237d8509d Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Mon, 5 Jan 2015 10:36:10 -0800 Subject: [PATCH] Fix test db temp file for windows, projector edit form notes clearing --- openlp/core/ui/projector/editform.py | 3 +-- tests/interfaces/openlp_core_ui/test_projectoreditform.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/projector/editform.py b/openlp/core/ui/projector/editform.py index ea48c5de5..aaf02eab2 100644 --- a/openlp/core/ui/projector/editform.py +++ b/openlp/core/ui/projector/editform.py @@ -132,8 +132,7 @@ class Ui_ProjectorEditForm(object): self.location_label.setText(translate('OpenLP.ProjectorEditForm', 'Location')) self.location_text.setText(self.projector.location) self.notes_label.setText(translate('OpenLP.ProjectorEditForm', 'Notes')) - self.notes_text.selectAll() - self.notes_text.cut() + self.notes_text.clear() self.notes_text.insertPlainText(self.projector.notes) diff --git a/tests/interfaces/openlp_core_ui/test_projectoreditform.py b/tests/interfaces/openlp_core_ui/test_projectoreditform.py index e622d8777..46cb73a36 100644 --- a/tests/interfaces/openlp_core_ui/test_projectoreditform.py +++ b/tests/interfaces/openlp_core_ui/test_projectoreditform.py @@ -32,6 +32,7 @@ class and methods. """ import os +import tempfile from unittest import TestCase from openlp.core.common import Registry, Settings @@ -42,7 +43,7 @@ from tests.functional import patch from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST1_DATA, TEST2_DATA -tmpfile = '/tmp/openlp-test-projectormanager.sql' +tmpfile = tempfile.mkstemp(prefix='openlp-test-projectormanager', suffix='.sql')[1] class TestProjectorEditForm(TestCase, TestMixin): @@ -75,6 +76,7 @@ class TestProjectorEditForm(TestCase, TestMixin): """ self.projectordb.session.close() del(self.projector_form) + os.remove(tmpfile) self.destroy_settings() def edit_form_add_projector_test(self):