comparison test/test_mailgw.py @ 3809:12fc9a8bd3e6

Fix bug in matching In-Reply-To header to existing Message-ID and add unit test.
author Erik Forsberg <forsberg@users.sourceforge.net>
date Sun, 21 Jan 2007 15:18:26 +0000
parents b4d655b2aacf
children 4536c0e544be
comparison
equal deleted inserted replaced
3808:36eb9e8faf30 3809:12fc9a8bd3e6
6 # 6 #
7 # This module is distributed in the hope that it will be useful, 7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # 10 #
11 # $Id: test_mailgw.py,v 1.79 2006-10-05 23:08:21 richard Exp $ 11 # $Id: test_mailgw.py,v 1.80 2007-01-21 15:18:25 forsberg Exp $
12 12
13 # TODO: test bcc 13 # TODO: test bcc
14 14
15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time
16 16
1283 assert not os.path.exists(SENDMAILDEBUG) 1283 assert not os.path.exists(SENDMAILDEBUG)
1284 self.assertEqual(self.db.issue.get(nodeid, 'title'), 1284 self.assertEqual(self.db.issue.get(nodeid, 'title'),
1285 'testing [assignedto=mary]') 1285 'testing [assignedto=mary]')
1286 self.assertEqual(self.db.issue.get(nodeid, 'assignedto'), None) 1286 self.assertEqual(self.db.issue.get(nodeid, 'assignedto'), None)
1287 1287
1288 def testReplytoMatch(self):
1289 self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'loose'
1290 nodeid = self.doNewIssue()
1291 nodeid2 = self._handle_mail('''Content-Type: text/plain;
1292 charset="iso-8859-1"
1293 From: Chef <chef@bork.bork.bork>
1294 To: issue_tracker@your.tracker.email.domain.example
1295 Message-Id: <dummy_test_message_id2>
1296 In-Reply-To: <dummy_test_message_id>
1297 Subject: Testing...
1298
1299 Followup message.
1300 ''')
1301 self.assertEqual(nodeid, nodeid2)
1302
1303
1288 def test_suite(): 1304 def test_suite():
1289 suite = unittest.TestSuite() 1305 suite = unittest.TestSuite()
1290 suite.addTest(unittest.makeSuite(MailgwTestCase)) 1306 suite.addTest(unittest.makeSuite(MailgwTestCase))
1291 return suite 1307 return suite
1292 1308

Roundup Issue Tracker: http://roundup-tracker.org/