comparison test/test_mailgw.py @ 3892:f762fa13cd8d

Automatically find out author of property-only changes... ...and add that information in the header of the generated message, replacing "System Message".
author Erik Forsberg <forsberg@users.sourceforge.net>
date Mon, 10 Sep 2007 19:18:39 +0000
parents 83748b2de465
children 21420ba64b0d
comparison
equal deleted inserted replaced
3891:410cae6ab7dd 3892:f762fa13cd8d
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.87 2007-09-01 16:30:11 forsberg Exp $ 11 # $Id: test_mailgw.py,v 1.88 2007-09-10 19:18:39 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
437 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> 437 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
438 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> 438 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
439 _______________________________________________________________________ 439 _______________________________________________________________________
440 ''') 440 ''')
441 441
442 def testPropertyChangeOnly(self):
443 self.doNewIssue()
444 oldvalues = self.db.getnode('issue', '1').copy()
445 oldvalues['assignedto'] = None
446 self.db.issue.set('1', assignedto=self.chef_id)
447 self.db.commit()
448 self.db.issue.nosymessage('1', None, oldvalues)
449
450
451 new_mail = ""
452 for line in self._get_mail().split("\n"):
453 if "Message-Id: " in line:
454 continue
455 if "Date: " in line:
456 continue
457 new_mail+=line+"\n"
458
459 self.compareMessages(new_mail, """
460 FROM: roundup-admin@your.tracker.email.domain.example
461 TO: chef@bork.bork.bork, richard@test
462 Content-Type: text/plain; charset=utf-8
463 Subject: [issue1] Testing...
464 To: chef@bork.bork.bork, richard@test
465 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example>
466 X-Roundup-Name: Roundup issue tracker
467 X-Roundup-Loop: hello
468 X-Roundup-Version: 1.3.3
469 MIME-Version: 1.0
470 Reply-To: Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
471 Content-Transfer-Encoding: quoted-printable
472
473
474 Change by Bork, Chef <chef@bork.bork.bork>:
475
476
477 ----------
478 assignedto: -> Chef
479
480 _______________________________________________________________________
481 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
482 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
483 _______________________________________________________________________
484 """)
485
442 486
443 # 487 #
444 # FOLLOWUP TITLE MATCH 488 # FOLLOWUP TITLE MATCH
445 # 489 #
446 def testFollowupTitleMatch(self): 490 def testFollowupTitleMatch(self):

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