@@ -1852,6 +1852,61 @@ def testNosyMessageCcBccEtc(self):
18521852----------
18531853assignedto: -> Chef
18541854
1855+ _______________________________________________________________________
1856+ Roundup issue tracker <[email protected] > 1857+ <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
1858+ _______________________________________________________________________
1859+ """ )
1860+
1861+
1862+ def testNosyMessageNoteFilter (self ):
1863+ def note_filter (original_note , issue_id , db , newvalues , oldvalues ):
1864+ return 'This content came from note_filter().'
1865+ self .doNewIssue ()
1866+ oldvalues = self .db .getnode ('issue' , '1' ).copy ()
1867+ oldvalues ['assignedto' ] = None
1868+ # reconstruct old behaviour: This would reuse the
1869+ # database-handle from the doNewIssue above which has committed
1870+ # as user "Chef". So we close and reopen the db as that user.
1871+ #self.db.close() actually don't close 'cos this empties memorydb
1872+ self .db = self .instance .open ('Chef' )
1873+ self .db .issue .set ('1' , assignedto = self .chef_id )
1874+ self .db .commit ()
1875+ self .db .issue .nosymessage ('1' , None , oldvalues ,
1876+ cc = ['3' ,'4' , '5' ],
1877+ 1878+ note_filter = note_filter )
1879+ new_mail = ""
1880+ # Message-Id: and Date: change every time - remove them.
1881+ for line in self ._get_mail ().split ("\n " ):
1882+ if "Message-Id: " in line :
1883+ continue
1884+ if "Date: " in line :
1885+ continue
1886+ new_mail += line + "\n "
1887+
1888+ self .compareMessages (new_mail , """
1889+ 1890+ 1891+ Content-Type: text/plain; charset="utf-8"
1892+ Subject: [issue1] Testing...
1893+ 1894+ From: "Bork, Chef" <[email protected] > 1895+ X-Roundup-Name: Roundup issue tracker
1896+ X-Roundup-Loop: hello
1897+ X-Roundup-Issue-Status: unread
1898+ X-Roundup-Version: 1.3.3
1899+ In-Reply-To: <dummy_test_message_id>
1900+ MIME-Version: 1.0
1901+ Reply-To: Roundup issue tracker
1902+ 1903+ Content-Transfer-Encoding: quoted-printable
1904+
1905+
1906+ Change by Bork, Chef <[email protected] >: 1907+
1908+ This content came from note_filter().
1909+
18551910_______________________________________________________________________
18561911Roundup issue tracker <[email protected] > 18571912<http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
0 commit comments