Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 5124:a927f9549af0
Fix issue2550751: Email Header Issue.
Noel Garces requested the ability to suppress email headers like
"x-roundup-issue-files". With Ralf's addition of the Link/Multilink
property attribute 'msg_header_property' we can do this
easily. Setting the 'msg_header_property' to the empty string '' (not
to None) will suppress the header for that property.
3 line code change, single test, doc updated and change note.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 03 Jul 2016 19:29:50 -0400 |
| parents | 226052e0cc4c |
| children | 410e565b5c1f |
comparison
equal
deleted
inserted
replaced
| 5123:226052e0cc4c | 5124:a927f9549af0 |
|---|---|
| 3394 _______________________________________________________________________ | 3394 _______________________________________________________________________ |
| 3395 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | 3395 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> |
| 3396 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> | 3396 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> |
| 3397 _______________________________________________________________________ | 3397 _______________________________________________________________________ |
| 3398 ''') | 3398 ''') |
| 3399 | |
| 3400 def testmsgHeaderPropertyEmptyString(self): | |
| 3401 ''' Test that setting the msg_header_property to an empty string | |
| 3402 suppresses the X-Roundup-issue-prop header in generated email. | |
| 3403 ''' | |
| 3404 reference_email = '''FROM: roundup-admin@your.tracker.email.domain.example | |
| 3405 TO: mary@test.test, richard@test.test | |
| 3406 Content-Type: text/plain; charset="utf-8" | |
| 3407 Subject: [issue1] set keyword | |
| 3408 To: mary@test.test, richard@test.test | |
| 3409 From: "Bork, Chef" <issue_tracker@your.tracker.email.domain.example> | |
| 3410 Reply-To: Roundup issue tracker | |
| 3411 <issue_tracker@your.tracker.email.domain.example> | |
| 3412 MIME-Version: 1.0 | |
| 3413 Message-Id: <followup_dummy_id> | |
| 3414 In-Reply-To: <dummy_test_message_id> | |
| 3415 X-Roundup-Name: Roundup issue tracker | |
| 3416 X-Roundup-Loop: hello | |
| 3417 X-Roundup-Issue-Status: chatting | |
| 3418 Content-Transfer-Encoding: quoted-printable | |
| 3419 | |
| 3420 Bork, Chef <chef@bork.bork.bork> added the comment: | |
| 3421 | |
| 3422 Set the Foo and Baz This keywords along with mary for nosy. | |
| 3423 | |
| 3424 ---------- | |
| 3425 keyword: +Baz This, Foo | |
| 3426 nosy: +mary | |
| 3427 status: unread -> chatting | |
| 3428 title: Testing... -> set keyword | |
| 3429 | |
| 3430 _______________________________________________________________________ | |
| 3431 Roundup issue tracker <issue_tracker@your.tracker.email.domain.example> | |
| 3432 <http://tracker.example/cgi-bin/roundup.cgi/bugs/issue1> | |
| 3433 _______________________________________________________________________ | |
| 3434 ''' | |
| 3435 self.db.keyword.create(name='Foo') | |
| 3436 self.db.keyword.create(name='Bar') | |
| 3437 self.db.keyword.create(name='Baz This') | |
| 3438 | |
| 3439 self.db.issue.properties['keyword'].msg_header_property='' | |
| 3440 | |
| 3441 nodeid1 = self.doNewIssue() | |
| 3442 nodeid2 = self._handle_mail('''Content-Type: text/plain; | |
| 3443 charset="iso-8859-1" | |
| 3444 From: "Bork, Chef" <chef@bork.bork.bork> | |
| 3445 To: issue_tracker@your.tracker.email.domain.example | |
| 3446 Message-Id: <followup_dummy_id> | |
| 3447 In-Reply-To: <dummy_test_message_id> | |
| 3448 Subject: [issue1] set keyword [ keyword =+ Foo,Baz This ; nosy =+ mary ] | |
| 3449 | |
| 3450 Set the Foo and Baz This keywords along with mary for nosy. | |
| 3451 ''') | |
| 3452 assert os.path.exists(SENDMAILDEBUG) | |
| 3453 self.compareMessages(self._get_mail(), reference_email) | |
| 3454 | |
| 3399 | 3455 |
| 3400 def testOutlookAttachment(self): | 3456 def testOutlookAttachment(self): |
| 3401 message = '''X-MimeOLE: Produced By Microsoft Exchange V6.5 | 3457 message = '''X-MimeOLE: Produced By Microsoft Exchange V6.5 |
| 3402 Content-class: urn:content-classes:message | 3458 Content-class: urn:content-classes:message |
| 3403 MIME-Version: 1.0 | 3459 MIME-Version: 1.0 |
