diff --git a/base_external_dbsource/README.rst b/base_external_dbsource/README.rst index f2b01e67..3acd4af8 100644 --- a/base_external_dbsource/README.rst +++ b/base_external_dbsource/README.rst @@ -96,6 +96,7 @@ Contributors * Gervais Naoussi * Dave Lasley * Sergio Teruel (https://wwww.tecnativa.com) +* Jairo Llopis (https://wwww.tecnativa.com) Maintainers ~~~~~~~~~~~ diff --git a/base_external_dbsource/readme/CONTRIBUTORS.rst b/base_external_dbsource/readme/CONTRIBUTORS.rst index 7826d82d..c6c89ba5 100644 --- a/base_external_dbsource/readme/CONTRIBUTORS.rst +++ b/base_external_dbsource/readme/CONTRIBUTORS.rst @@ -3,3 +3,4 @@ * Gervais Naoussi * Dave Lasley * Sergio Teruel (https://wwww.tecnativa.com) +* Jairo Llopis (https://wwww.tecnativa.com) diff --git a/base_external_dbsource/static/description/index.html b/base_external_dbsource/static/description/index.html index 119b31a4..6aef0073 100644 --- a/base_external_dbsource/static/description/index.html +++ b/base_external_dbsource/static/description/index.html @@ -447,6 +447,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Gervais Naoussi <gervaisnaoussi@gmail.com>
  • Dave Lasley <dave@laslabs.com>
  • Sergio Teruel <sergio.teruel@tecnativa.com> (https://wwww.tecnativa.com)
  • +
  • Jairo Llopis <jairo.llopis@tecnativa.com> (https://wwww.tecnativa.com)
  • diff --git a/base_external_dbsource/tests/test_base_external_dbsource.py b/base_external_dbsource/tests/test_base_external_dbsource.py index 0ee52ee2..917c0ac6 100644 --- a/base_external_dbsource/tests/test_base_external_dbsource.py +++ b/base_external_dbsource/tests/test_base_external_dbsource.py @@ -3,6 +3,7 @@ import mock from odoo.tests import common +from odoo.sql_db import connection_info_for from ..exceptions import ConnectionFailedError, ConnectionSuccessError @@ -11,7 +12,22 @@ class TestBaseExternalDbsource(common.TransactionCase): def setUp(self): super(TestBaseExternalDbsource, self).setUp() - self.dbsource = self.env.ref('base_external_dbsource.demo_postgre') + # Obtain current odoo instance DB connection settings + connection_info = connection_info_for(self.env.cr.dbname)[1] + # Adapt to the format expected by this module + password = connection_info.get("password", "") + connection_info["password"] = "%s" + connection_info["dbname"] = connection_info["database"] + del connection_info["database"] + # Create a proper dbsource record to test + self.dbsource = self.env["base.external.dbsource"].create({ + "conn_string": " ".join( + "%s='%s'" % item for item in connection_info.items() + ), + "connector": "postgresql", + "name": "test postgres with current odoo config", + "password": password, + }) def _test_adapter_method( self, method_name, side_effect=None, return_value=None,