comparison test/test_mailgw.py @ 5081:786f0581bc90

issue2109308 add subject argument to nosymessage. Initial patch Frank Niessink. Test and application with slight mods by rouilj
author John Rouillard <rouilj@ieee.org>
date Sat, 11 Jun 2016 18:06:18 -0400
parents 2706b66675bf
children 99e289359798
comparison
equal deleted inserted replaced
5080:89d69a822e5c 5081:786f0581bc90
1404 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> 1404 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
1405 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> 1405 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
1406 _______________________________________________________________________ 1406 _______________________________________________________________________
1407 """) 1407 """)
1408 1408
1409
1410 def testNosyMessageSettingSubject(self):
1411 self.doNewIssue()
1412 oldvalues = self.db.getnode('issue', '1').copy()
1413 oldvalues['assignedto'] = None
1414 # reconstruct old behaviour: This would reuse the
1415 # database-handle from the doNewIssue above which has committed
1416 # as user "Chef". So we close and reopen the db as that user.
1417 #self.db.close() actually don't close 'cos this empties memorydb
1418 self.db = self.instance.open('Chef')
1419 self.db.issue.set('1', assignedto=self.chef_id)
1420 self.db.commit()
1421 self.db.issue.nosymessage('1', None, oldvalues, subject="test")
1422
1423 new_mail = ""
1424 for line in self._get_mail().split("\n"):
1425 if "Message-Id: " in line:
1426 continue
1427 if "Date: " in line:
1428 continue
1429 new_mail += line+"\n"
1430
1431 self.compareMessages(new_mail, """
1432 FROM: roundup-admin@your.tracker.email.domain.example
1433 TO: chef@bork.bork.bork, richard@test.test
1434 Content-Type: text/plain; charset="utf-8"
1435 Subject: test
1436 To: chef@bork.bork.bork, richard@test.test
1437 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example>
1438 X-Roundup-Name: Roundup issue tracker
1439 X-Roundup-Loop: hello
1440 X-Roundup-Issue-Status: unread
1441 X-Roundup-Version: 1.3.3
1442 In-Reply-To: <dummy_test_message_id>
1443 MIME-Version: 1.0
1444 Reply-To: Roundup issue tracker
1445 <issue_tracker@your.tracker.email.domain.example>
1446 Content-Transfer-Encoding: quoted-printable
1447
1448
1449 Change by Bork, Chef <chef@bork.bork.bork>:
1450
1451
1452 ----------
1453 assignedto: -> Chef
1454
1455 _______________________________________________________________________
1456 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
1457 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
1458 _______________________________________________________________________
1459 """)
1409 1460
1410 # 1461 #
1411 # FOLLOWUP TITLE MATCH 1462 # FOLLOWUP TITLE MATCH
1412 # 1463 #
1413 def testFollowupTitleMatch(self): 1464 def testFollowupTitleMatch(self):

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