comparison test/test_mailgw.py @ 5150:0c9eed9c4029

Add test for msg_header_property of assignedto
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 18 Jul 2016 13:55:34 +0200
parents 410e565b5c1f
children 6bbb6dd97458
comparison
equal deleted inserted replaced
5149:cc4f4ee46d88 5150:0c9eed9c4029
3441 _______________________________________________________________________ 3441 _______________________________________________________________________
3442 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> 3442 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
3443 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> 3443 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
3444 _______________________________________________________________________ 3444 _______________________________________________________________________
3445 ''') 3445 ''')
3446
3447 def testmsgHeaderPropertyAssignedto(self):
3448 ''' Test that setting the msg_header_property to an empty string
3449 suppresses the X-Roundup-issue-prop header in generated email.
3450 '''
3451 reference_email = '''FROM: roundup-admin@your.tracker.email.domain.example
3452 TO: mary@test.test, richard@test.test
3453 Content-Type: text/plain; charset="utf-8"
3454 Subject: [issue1] set assignedto
3455 To: mary@test.test, richard@test.test
3456 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example>
3457 Reply-To: Roundup issue tracker
3458 <issue_tracker@your.tracker.email.domain.example>
3459 MIME-Version: 1.0
3460 Message-Id: <followup_dummy_id>
3461 In-Reply-To: <dummy_test_message_id>
3462 X-Roundup-Name: Roundup issue tracker
3463 X-Roundup-Loop: hello
3464 X-Roundup-Issue-Status: chatting
3465 X-Roundup-Issue-Assignedto: mary
3466 Content-Transfer-Encoding: quoted-printable
3467
3468 Bork, Chef <chef@bork.bork.bork> added the comment:
3469
3470 Check that assignedto makes it into an X-Header
3471
3472 ----------
3473 assignedto: -> mary
3474 nosy: +mary
3475 status: unread -> chatting
3476 title: Testing... -> set assignedto
3477
3478 _______________________________________________________________________
3479 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example>
3480 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1>
3481 _______________________________________________________________________
3482 '''
3483 self.db.issue.properties['assignedto'].msg_header_property='username'
3484
3485 nodeid1 = self.doNewIssue()
3486 nodeid2 = self._handle_mail('''Content-Type: text/plain;
3487 charset="iso-8859-1"
3488 From: "Bork, Chef" <chef@bork.bork.bork>
3489 To: issue_tracker@your.tracker.email.domain.example
3490 Message-Id: <followup_dummy_id>
3491 In-Reply-To: <dummy_test_message_id>
3492 Subject: [issue1] set assignedto [assignedto=mary]
3493
3494 Check that assignedto makes it into an X-Header
3495 ''')
3496 assert os.path.exists(SENDMAILDEBUG)
3497 self.compareMessages(self._get_mail(), reference_email)
3446 3498
3447 def testmsgHeaderPropertyEmptyString(self): 3499 def testmsgHeaderPropertyEmptyString(self):
3448 ''' Test that setting the msg_header_property to an empty string 3500 ''' Test that setting the msg_header_property to an empty string
3449 suppresses the X-Roundup-issue-prop header in generated email. 3501 suppresses the X-Roundup-issue-prop header in generated email.
3450 ''' 3502 '''

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