Use a in-memory sqlite DB for projector test, instead of filebased. Fixes a filelock issue in windows tests.

This commit is contained in:
Tomas Groth 2015-01-14 11:57:54 +01:00
parent cffad28749
commit dc3cd41576
1 changed files with 1 additions and 7 deletions

View File

@ -31,8 +31,6 @@ Interface tests to test the openlp.core.ui.projector.editform.ProjectorEditForm(
class and methods.
"""
import os
import tempfile
from unittest import TestCase
from openlp.core.common import Registry, Settings
@ -43,8 +41,6 @@ from tests.functional import patch
from tests.helpers.testmixin import TestMixin
from tests.resources.projector.data import TEST1_DATA, TEST2_DATA
tmpfile = tempfile.mkstemp(prefix='openlp-test-projectormanager', suffix='.sql')[1]
class TestProjectorEditForm(TestCase, TestMixin):
"""
@ -60,8 +56,7 @@ class TestProjectorEditForm(TestCase, TestMixin):
self.setup_application()
Registry.create()
with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url:
mocked_init_url.start()
mocked_init_url.return_value = 'sqlite:///{}'.format(tmpfile)
mocked_init_url.return_value = 'sqlite://'
self.projectordb = ProjectorDB()
self.projector_form = ProjectorEditForm(projectordb=self.projectordb)
@ -74,7 +69,6 @@ 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):