mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[MIG] base_external_dbsource_mysql: Migration to 15.0
TT37274
This commit is contained in:
committed by
David Alonso // Solvos
parent
af80458cb4
commit
52bf85d200
@@ -11,7 +11,7 @@ ADAPTER = (
|
||||
|
||||
class TestBaseExternalDbsource(common.TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestBaseExternalDbsource, self).setUp()
|
||||
super().setUp()
|
||||
self.dbsource = self.env.ref("base_external_dbsource_mysql.demo_mysql")
|
||||
|
||||
def test_connection_close_mysql(self):
|
||||
@@ -22,13 +22,15 @@ class TestBaseExternalDbsource(common.TransactionCase):
|
||||
|
||||
def test_connection_open_mysql(self):
|
||||
"""It should call SQLAlchemy open"""
|
||||
with mock.patch.object(self.dbsource, "connection_open_mysql") as parent_method:
|
||||
with mock.patch.object(
|
||||
type(self.dbsource), "connection_open_mysql"
|
||||
) as parent_method:
|
||||
self.dbsource.connection_open_mysql()
|
||||
parent_method.assert_called_once_with()
|
||||
|
||||
def test_excecute_mysql(self):
|
||||
"""It should pass args to SQLAlchemy execute"""
|
||||
expect = "sqlquery", "sqlparams", "metadata"
|
||||
with mock.patch.object(self.dbsource, "execute_mysql") as parent_method:
|
||||
with mock.patch.object(type(self.dbsource), "execute_mysql") as parent_method:
|
||||
self.dbsource.execute_mysql(*expect)
|
||||
parent_method.assert_called_once_with(*expect)
|
||||
|
||||
Reference in New Issue
Block a user