summaryrefslogtreecommitdiff
path: root/openerp/sql_db.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2014-04-09 15:08:25 +0200
committerRaphael Collet <rco@openerp.com>2014-04-09 15:08:25 +0200
commitdda229273dd372717c6b0ebb9c4042aaae4e8729 (patch)
tree9af483126578155e2b4db7283f353e37dae04df4 /openerp/sql_db.py
parentfd8fd0906f3ecb79c9316d4dffbc6ae0b6377de7 (diff)
[IMP] sql_db: simplify TestCursor, given that method execute() does not need overriding
bzr revid: rco@openerp.com-20140409130825-rnc9hqh9t16hqcaq
Diffstat (limited to 'openerp/sql_db.py')
-rw-r--r--openerp/sql_db.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/openerp/sql_db.py b/openerp/sql_db.py
index 126460f5317..be8c91954b9 100644
--- a/openerp/sql_db.py
+++ b/openerp/sql_db.py
@@ -389,7 +389,7 @@ class TestCursor(Cursor):
# in order to simulate commit and rollback, the cursor maintains a
# savepoint at its last commit
super(TestCursor, self).__init__(*args, **kwargs)
- super(TestCursor, self).execute("SAVEPOINT test_cursor")
+ self.execute("SAVEPOINT test_cursor")
self._lock = threading.RLock()
def acquire(self):
@@ -398,9 +398,6 @@ class TestCursor(Cursor):
def release(self):
self._lock.release()
- def execute(self, *args, **kwargs):
- super(TestCursor, self).execute(*args, **kwargs)
-
def close(self, force=False):
if force:
super(TestCursor, self).close()
@@ -412,12 +409,12 @@ class TestCursor(Cursor):
_logger.debug("TestCursor.autocommit(%r) does nothing", on)
def commit(self):
- super(TestCursor, self).execute("RELEASE SAVEPOINT test_cursor")
- super(TestCursor, self).execute("SAVEPOINT test_cursor")
+ self.execute("RELEASE SAVEPOINT test_cursor")
+ self.execute("SAVEPOINT test_cursor")
def rollback(self):
- super(TestCursor, self).execute("ROLLBACK TO SAVEPOINT test_cursor")
- super(TestCursor, self).execute("SAVEPOINT test_cursor")
+ self.execute("ROLLBACK TO SAVEPOINT test_cursor")
+ self.execute("SAVEPOINT test_cursor")
class PsycoConnection(psycopg2.extensions.connection):
pass