Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 6247:ca0915457761
Handle auto-submitted header on inbound email like bulk.
Part of issue2550564.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 28 Jul 2020 20:58:04 -0400 |
| parents | ad0ece9cb01b |
| children | 778a9f455067 |
comparison
equal
deleted
inserted
replaced
| 6246:4155ed7f00f4 | 6247:ca0915457761 |
|---|---|
| 3588 Subject: Re: [issue] Testing... | 3588 Subject: Re: [issue] Testing... |
| 3589 | 3589 |
| 3590 Hi, I'm on holidays, and this is a dumb auto-responder. | 3590 Hi, I'm on holidays, and this is a dumb auto-responder. |
| 3591 ''') | 3591 ''') |
| 3592 | 3592 |
| 3593 def testItsAutoSubmittedStupid(self): | |
| 3594 self.assertRaises(IgnoreBulk, self._handle_mail, | |
| 3595 '''Content-Type: text/plain; | |
| 3596 charset="iso-8859-1" | |
| 3597 From: Chef <chef@bork.bork.bork> | |
| 3598 Auto-Submitted: Auto-Generated | |
| 3599 To: issue_tracker@your.tracker.email.domain.example | |
| 3600 Cc: richard@test.test | |
| 3601 Message-Id: <dummy_test_message_id> | |
| 3602 Subject: Re: [issue] Testing... | |
| 3603 | |
| 3604 Hi, I'm on holidays, and this is a dumb auto-responder. | |
| 3605 ''') | |
| 3606 | |
| 3607 def testItsHumanSubmitted(self): | |
| 3608 ''' keep trailing spaces on Auto-submitted header | |
| 3609 ''' | |
| 3610 self.db.keyword.create(name='Foo') | |
| 3611 self._handle_mail('''Content-Type: text/plain; | |
| 3612 charset="iso-8859-1" | |
| 3613 From: richard <richard@test.test> | |
| 3614 To: issue_tracker@your.tracker.email.domain.example | |
| 3615 Message-Id: <followup_dummy_id> | |
| 3616 In-Reply-To: <dummy_test_message_id> | |
| 3617 Auto-submitted: No | |
| 3618 Subject: [keyword1] Testing... [name=Bar] | |
| 3619 | |
| 3620 ''') | |
| 3621 self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') | |
| 3622 | |
| 3623 | |
| 3593 def testAutoReplyEmailsAreIgnored(self): | 3624 def testAutoReplyEmailsAreIgnored(self): |
| 3594 self.assertRaises(IgnoreBulk, self._handle_mail, | 3625 self.assertRaises(IgnoreBulk, self._handle_mail, |
| 3595 '''Content-Type: text/plain; | 3626 '''Content-Type: text/plain; |
| 3596 charset="iso-8859-1" | 3627 charset="iso-8859-1" |
| 3597 From: Chef <chef@bork.bork.bork> | 3628 From: Chef <chef@bork.bork.bork> |
