~barry/mailman/lp1423756

« back to all changes in this revision

Viewing changes to src/mailman/app/tests/test_bounces.py

  • Committer: Barry Warsaw
  • Date: 2015-01-05 01:20:33 UTC
  • mfrom: (7264.4.66 py3)
  • Revision ID: barry@list.org-20150105012033-zdrw9c2odhpf22fz
Merge the Python 3 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Testing app.bounces functions."""
19
19
 
20
 
from __future__ import absolute_import, print_function, unicode_literals
21
 
 
22
 
__metaclass__ = type
23
20
__all__ = [
24
21
    'TestBounceMessage',
25
22
    'TestMaybeForward',
36
33
import tempfile
37
34
import unittest
38
35
 
39
 
from zope.component import getUtility
40
 
 
41
36
from mailman.app.bounces import (
42
37
    ProbeVERP, StandardVERP, bounce_message, maybe_forward, send_probe)
43
38
from mailman.app.lifecycle import create_list
49
44
from mailman.interfaces.pending import IPendings
50
45
from mailman.interfaces.usermanager import IUserManager
51
46
from mailman.testing.helpers import (
52
 
    LogFileMark,
53
 
    get_queue_messages,
54
 
    specialized_message_from_string as mfs)
 
47
    LogFileMark, get_queue_messages, specialized_message_from_string as mfs)
55
48
from mailman.testing.layers import ConfigLayer
 
49
from zope.component import getUtility
56
50
 
57
51
 
58
52
 
334
328
        send_probe(self._member, self._msg)
335
329
        message = get_queue_messages('virgin')[0].msg
336
330
        self.assertEqual(
337
 
            message['Subject'],
 
331
            message['subject'].encode(),
338
332
            '=?utf-8?q?ailing-may_ist-lay_Test_obe-pray_essage-may?=')
339
333
 
340
334
    def test_probe_notice_with_member_nonenglish(self):
533
527
 
534
528
    def test_no_sender(self):
535
529
        # The message won't be bounced if it has no discernible sender.
536
 
        self._msg.sender = None
 
530
        del self._msg['from']
537
531
        bounce_message(self._mlist, self._msg)
538
532
        items = get_queue_messages('virgin')
539
533
        # Nothing in the virgin queue means nothing's been bounced.