Skip to content
Snippets Groups Projects
Commit 0c42a607 authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] base: correct TestCursor test to explicitly close the cursor

parent 9c6acbaa
Branches
Tags
No related merge requests found
......@@ -33,13 +33,22 @@ class TestExecute(unittest.TestCase):
class TestTestCursor(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestTestCursor, cls).setUpClass()
r = registry()
r.enter_test_mode(r.cursor())
@classmethod
def tearDownClass(cls):
r = registry()
r.test_cr.close()
r.leave_test_mode()
super(TestTestCursor, cls).tearDownClass()
def setUp(self):
super(TestTestCursor, self).setUp()
self.registry.enter_test_mode(self.cr)
self.addCleanup(self.registry.leave_test_mode)
self.record = self.env['res.partner'].create({'name': 'Foo'})
self.cr = self.cursor()
def write(self, record, value):
record.ref = value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment