From 1a89c3b029f924d9d47504527dad3c0d83f4b080 Mon Sep 17 00:00:00 2001 From: Ryan Cole Date: Wed, 31 Jul 2024 11:20:28 +1200 Subject: [PATCH] Fix issue with mock cursor in tests --- users_ldap_groups/tests/test_users_ldap_groups.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/users_ldap_groups/tests/test_users_ldap_groups.py b/users_ldap_groups/tests/test_users_ldap_groups.py index bc3ce671a..26b8c70ef 100644 --- a/users_ldap_groups/tests/test_users_ldap_groups.py +++ b/users_ldap_groups/tests/test_users_ldap_groups.py @@ -15,16 +15,16 @@ def mock_cursor(cr): with mock.patch("odoo.sql_db.Connection.cursor") as mocked_cursor_call: org_close = cr.close - org_autocommit = cr.autocommit + org_autocommit = cr.connection.set_isolation_level try: cr.close = mock.Mock() - cr.autocommit = mock.Mock() + cr.connection.set_isolation_level = mock.Mock() cr.commit = mock.Mock() mocked_cursor_call.return_value = cr yield finally: cr.close = org_close - cr.autocommit = org_autocommit + cr.connection.set_isolation_level = org_autocommit class FakeLdapConnection: