~barry/mailman/events-and-web

« back to all changes in this revision

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

  • Committer: Barry Warsaw
  • Date: 2012-08-18 02:27:32 UTC
  • Revision ID: barry@list.org-20120818022732-apfxcilwghm36bfc
 * Non-unicode values in msgdata broke pending requests. (LP: #1031391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
from mailman.testing.helpers import (
38
38
    make_testable_runner, specialized_message_from_string)
39
39
from mailman.testing.layers import SMTPLayer
 
40
from mailman.utilities.datetime import now
40
41
 
41
42
 
42
43
 
109
110
        handle_message(self._mlist, request_id, Action.hold)
110
111
        key, data = requests_db.get_request(request_id)
111
112
        self.assertEqual(key, '<alpha>')
 
113
 
 
114
    def test_lp_1031391(self):
 
115
        # LP: #1031391 msgdata['received_time'] gets added by the LMTP server.
 
116
        # The value is a datetime.  If this message gets held, it will break
 
117
        # pending requests since they require string keys and values.
 
118
        received_time = now()
 
119
        msgdata = dict(received_time=received_time)
 
120
        request_id = hold_message(self._mlist, self._msg, msgdata)
 
121
        requests_db = IListRequests(self._mlist)
 
122
        key, data = requests_db.get_request(request_id)
 
123
        self.assertEqual(data['received_time'], received_time)