diff -r 901d7ba146ad test/test_mailgw.py --- a/test/test_mailgw.py Thu Sep 27 11:38:05 2018 +0000 +++ b/test/test_mailgw.py Mon Mar 25 12:36:13 2019 -0700 @@ -1859,6 +1859,61 @@ """) + def testNosyMessageNoteFilter(self): + def note_filter(original_note, issue_id, db, newvalues, oldvalues): + return 'This content came from note_filter().' + self.doNewIssue() + oldvalues = self.db.getnode('issue', '1').copy() + oldvalues['assignedto'] = None + # reconstruct old behaviour: This would reuse the + # database-handle from the doNewIssue above which has committed + # as user "Chef". So we close and reopen the db as that user. + #self.db.close() actually don't close 'cos this empties memorydb + self.db = self.instance.open('Chef') + self.db.issue.set('1', assignedto=self.chef_id) + self.db.commit() + self.db.issue.nosymessage('1', None, oldvalues, + cc=['3','4', '5'], + cc_emails=['john@example.com'], + note_filter=note_filter) + new_mail = "" + # Message-Id: and Date: change every time - remove them. + for line in self._get_mail().split("\n"): + if "Message-Id: " in line: + continue + if "Date: " in line: + continue + new_mail += line+"\n" + + self.compareMessages(new_mail, """ +FROM: roundup-admin@your.tracker.email.domain.example +TO: chef@bork.bork.bork, fred@example.com, john@example.com, richard@test.test +Content-Type: text/plain; charset="utf-8" +Subject: [issue1] Testing... +To: chef@bork.bork.bork, fred@example.com, john@example.com, richard@test.test +From: "Bork, Chef" +X-Roundup-Name: Roundup issue tracker +X-Roundup-Loop: hello +X-Roundup-Issue-Status: unread +X-Roundup-Version: 1.3.3 +In-Reply-To: +MIME-Version: 1.0 +Reply-To: Roundup issue tracker + +Content-Transfer-Encoding: quoted-printable + + +Change by Bork, Chef : + +This content came from note_filter(). + +_______________________________________________________________________ +Roundup issue tracker + +_______________________________________________________________________ +""") + + def testPropertyChangeOnly(self): self.doNewIssue() oldvalues = self.db.getnode('issue', '1').copy()