@@ -1706,6 +1706,101 @@ def testNosyGeneration(self):
17061706_______________________________________________________________________
17071707''' )
17081708
1709+ def testNosyMessageCcBccEtc (self ):
1710+ self .doNewIssue ()
1711+ oldvalues = self .db .getnode ('issue' , '1' ).copy ()
1712+ oldvalues ['assignedto' ] = None
1713+ # reconstruct old behaviour: This would reuse the
1714+ # database-handle from the doNewIssue above which has committed
1715+ # as user "Chef". So we close and reopen the db as that user.
1716+ #self.db.close() actually don't close 'cos this empties memorydb
1717+ self .db = self .instance .open ('Chef' )
1718+ self .db .issue .set ('1' , assignedto = self .chef_id )
1719+ self .db .commit ()
1720+ # note user 3 is both in cc and bcc. The one in cc takes
1721+ # precedence and stops the bcc copy from being sent to user 3..
1722+ # new email is generated for bcc peoples: admin and kermit
1723+ # get it.
1724+ self .db .issue .nosymessage ('1' , None , oldvalues ,
1725+ cc = ['3' ,'4' , '5' ], bcc = ['1' , '3' , '5' ],
1726+ 1727+ 1728+ new_mail = ""
1729+ for line in self ._get_mail ().split ("\n " ):
1730+ if "Message-Id: " in line :
1731+ continue
1732+ if "Date: " in line :
1733+ continue
1734+ new_mail += line + "\n "
1735+
1736+ # new_mail is a mbox style string with 2 emails.
1737+ # we need to split the emails and compare.
1738+ new_mails = new_mail .split ("\n From " )
1739+ # restore the "From " prefix removed from first line of
1740+ # second message by strip.
1741+ new_mails [1 ]= "From " + new_mail .split ("\n From " )[1 ]
1742+
1743+ self .compareMessages (new_mails [0 ], """
1744+ 1745+ 1746+ Content-Type: text/plain; charset="utf-8"
1747+ Subject: [issue1] Testing...
1748+ 1749+ From: "Bork, Chef" <[email protected] > 1750+ X-Roundup-Name: Roundup issue tracker
1751+ X-Roundup-Loop: hello
1752+ X-Roundup-Issue-Status: unread
1753+ X-Roundup-Version: 1.3.3
1754+ In-Reply-To: <dummy_test_message_id>
1755+ MIME-Version: 1.0
1756+ Reply-To: Roundup issue tracker
1757+ 1758+ Content-Transfer-Encoding: quoted-printable
1759+
1760+
1761+ Change by Bork, Chef <[email protected] >: 1762+
1763+
1764+ ----------
1765+ assignedto: -> Chef
1766+
1767+ _______________________________________________________________________
1768+ Roundup issue tracker <[email protected] > 1769+ <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
1770+ _______________________________________________________________________
1771+ """ )
1772+
1773+ self .compareMessages (new_mails [1 ], """
1774+ 1775+ 1776+ Content-Type: text/plain; charset="utf-8"
1777+ Subject: [issue1] Testing...
1778+ 1779+ From: "Bork, Chef" <[email protected] > 1780+ X-Roundup-Name: Roundup issue tracker
1781+ X-Roundup-Loop: hello
1782+ X-Roundup-Issue-Status: unread
1783+ X-Roundup-Version: 1.3.3
1784+ In-Reply-To: <dummy_test_message_id>
1785+ MIME-Version: 1.0
1786+ Reply-To: Roundup issue tracker
1787+ 1788+ Content-Transfer-Encoding: quoted-printable
1789+
1790+
1791+ Change by Bork, Chef <[email protected] >: 1792+
1793+
1794+ ----------
1795+ assignedto: -> Chef
1796+
1797+ _______________________________________________________________________
1798+ Roundup issue tracker <[email protected] > 1799+ <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
1800+ _______________________________________________________________________
1801+ """ )
1802+
1803+
17091804 def testPropertyChangeOnly (self ):
17101805 self .doNewIssue ()
17111806 oldvalues = self .db .getnode ('issue' , '1' ).copy ()
0 commit comments