[testlib] Fix mail monkeypatch in testlib stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 06 Oct 2010 14:56:43 +0200
branchstable
changeset 6403 b7e24d49639b
parent 6399 5f08485e3b11
child 6404 2013ef8f56e9
child 6405 6989f0e02542
[testlib] Fix mail monkeypatch in testlib ea26eb5fd388 in stable introduce monkeypatching of SendMailOp.commit_event 8bc6eac1fac1 in default rename SendMailOp.commit_event to postcommit_event d7f5d873e1b8 merge stable in default without handling the rename.
devtools/testlib.py
--- a/devtools/testlib.py	Wed Oct 06 10:47:29 2010 +0200
+++ b/devtools/testlib.py	Wed Oct 06 14:56:43 2010 +0200
@@ -293,8 +293,8 @@
 
     def setUp(self):
         # monkey patch send mail operation so emails are sent synchronously
-        self._old_mail_commit_event = SendMailOp.commit_event
-        SendMailOp.commit_event = SendMailOp.sendmails
+        self._old_mail_postcommit_event = SendMailOp.postcommit_event
+        SendMailOp.postcommit_event = SendMailOp.sendmails
         pause_tracing()
         previous_failure = self.__class__.__dict__.get('_repo_init_failed')
         if previous_failure is not None:
@@ -316,7 +316,7 @@
         for cnx in self._cnxs:
             if not cnx._closed:
                 cnx.close()
-        SendMailOp.commit_event = self._old_mail_commit_event
+        SendMailOp.postcommit_event = self._old_mail_postcommit_event
 
     def setup_database(self):
         """add your database setup code by overriding this method"""