forked from openlp/openlp
Another attempt to fix projector test across platforms and versions
This commit is contained in:
parent
612041dafa
commit
6af0aef8bd
@ -85,8 +85,11 @@ class TestProjectorDB(TestCase):
|
|||||||
Set up anything necessary for all tests
|
Set up anything necessary for all tests
|
||||||
"""
|
"""
|
||||||
if not hasattr(self, 'projector'):
|
if not hasattr(self, 'projector'):
|
||||||
with patch('openlp.core.lib.db.init_url') as mocked_init_url:
|
# We need to patch this twice to make it work across multiple platforms and versions.
|
||||||
mocked_init_url.return_value = 'sqlite:///%s' % tmpfile
|
with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \
|
||||||
|
patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2:
|
||||||
|
mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile
|
||||||
|
mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile
|
||||||
self.projector = ProjectorDB()
|
self.projector = ProjectorDB()
|
||||||
|
|
||||||
def find_record_by_ip_test(self):
|
def find_record_by_ip_test(self):
|
||||||
|
@ -57,8 +57,11 @@ class TestProjectorManager(TestCase, TestMixin):
|
|||||||
self.setup_application()
|
self.setup_application()
|
||||||
Registry.create()
|
Registry.create()
|
||||||
if not hasattr(self, 'projector_manager'):
|
if not hasattr(self, 'projector_manager'):
|
||||||
with patch('openlp.core.lib.db.init_url') as mocked_init_url:
|
# We need to patch this twice to make it work across multiple platforms and versions.
|
||||||
mocked_init_url.return_value = 'sqlite:///%s' % tmpfile
|
with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \
|
||||||
|
patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2:
|
||||||
|
mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile
|
||||||
|
mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile
|
||||||
self.projectordb = ProjectorDB()
|
self.projectordb = ProjectorDB()
|
||||||
if not hasattr(self, 'projector_manager'):
|
if not hasattr(self, 'projector_manager'):
|
||||||
self.projector_manager = ProjectorManager(projectordb=self.projectordb)
|
self.projector_manager = ProjectorManager(projectordb=self.projectordb)
|
||||||
|
Loading…
Reference in New Issue
Block a user