diff options
| author | Barry Warsaw | 2012-04-04 15:24:18 -0600 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-04 15:24:18 -0600 |
| commit | 53633149a247243efe830d7175906dc204423f41 (patch) | |
| tree | d36c80c19c26c21a19c988d850d15dbd6a9961d9 /src/mailman/rules/tests/test_approved.py | |
| parent | 2c4779c884d2bb09bed6838b7b5cd938d5755f2e (diff) | |
| parent | d695a5f65c44be347d007a923874f8cfd836b9de (diff) | |
| download | mailman-53633149a247243efe830d7175906dc204423f41.tar.gz mailman-53633149a247243efe830d7175906dc204423f41.tar.zst mailman-53633149a247243efe830d7175906dc204423f41.zip | |
Diffstat (limited to 'src/mailman/rules/tests/test_approved.py')
| -rw-r--r-- | src/mailman/rules/tests/test_approved.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/mailman/rules/tests/test_approved.py b/src/mailman/rules/tests/test_approved.py new file mode 100644 index 000000000..8ffe68aa9 --- /dev/null +++ b/src/mailman/rules/tests/test_approved.py @@ -0,0 +1,63 @@ +# Copyright (C) 2012 by the Free Software Foundation, Inc. +# +# This file is part of GNU Mailman. +# +# GNU Mailman is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. + +"""Test the mime_delete handler.""" + +from __future__ import absolute_import, print_function, unicode_literals + +__metaclass__ = type +__all__ = [ + 'TestApproved', + ] + + +import unittest + +from mailman.app.lifecycle import create_list +from mailman.rules import approved +from mailman.testing.helpers import ( + specialized_message_from_string as mfs) +from mailman.testing.layers import ConfigLayer + + + +class TestApproved(unittest.TestCase): + """Test the approved handler.""" + + layer = ConfigLayer + + def setUp(self): + self._mlist = create_list('test@example.com') + self._rule = approved.Approved() + self._msg = mfs("""\ +From: anne@example.com +To: test@example.com +Subject: A Message with non-ascii body +Message-ID: <ant> +MIME-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +This is a message body with a non-ascii character =E4 + +""") + + def test_nonascii_body_missing_header(self): + # When the message body contains non-ascii, the rule should not throw + # unicode errors. LP: #949924. + result = self._rule.check(self._mlist, self._msg, {}) + self.assertFalse(result) |
