Skip to content

Commit 1a89c3b

Browse files
committed
Fix issue with mock cursor in tests
1 parent 8dde183 commit 1a89c3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

users_ldap_groups/tests/test_users_ldap_groups.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
def mock_cursor(cr):
1616
with mock.patch("odoo.sql_db.Connection.cursor") as mocked_cursor_call:
1717
org_close = cr.close
18-
org_autocommit = cr.autocommit
18+
org_autocommit = cr.connection.set_isolation_level
1919
try:
2020
cr.close = mock.Mock()
21-
cr.autocommit = mock.Mock()
21+
cr.connection.set_isolation_level = mock.Mock()
2222
cr.commit = mock.Mock()
2323
mocked_cursor_call.return_value = cr
2424
yield
2525
finally:
2626
cr.close = org_close
27-
cr.autocommit = org_autocommit
27+
cr.connection.set_isolation_level = org_autocommit
2828

2929

3030
class FakeLdapConnection:

0 commit comments

Comments
 (0)