test: use db.before_commit
This commit is contained in:
parent
6519651002
commit
ccc107b41f
2 changed files with 1 additions and 2 deletions
|
|
@ -976,7 +976,6 @@ class Database:
|
|||
|
||||
def commit(self):
|
||||
"""Commit current transaction. Calls SQL `COMMIT`."""
|
||||
# Invalidated by a commit.
|
||||
self.before_rollback.reset()
|
||||
self.after_rollback.reset()
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class FrappeTestCase(unittest.TestCase):
|
|||
# flush changes done so far to avoid flake
|
||||
frappe.db.commit()
|
||||
if cls.SHOW_TRANSACTION_COMMIT_WARNINGS:
|
||||
frappe.db.add_before_commit(_commit_watcher)
|
||||
frappe.db.before_commit.add(_commit_watcher)
|
||||
|
||||
# enqueue teardown actions (executed in LIFO order)
|
||||
cls.addClassCleanup(_restore_thread_locals, copy.deepcopy(frappe.local.flags))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue