From b2f9db1637021f5a0a0c201017f6536243ed203f Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 12 Oct 2016 14:23:37 -0400 Subject: [PATCH] Removed redundant usage of assertNotIn() in a mail test. The Content-Transfer-Encoding header won't be repeated, so checking the header is sufficient. --- tests/mail/tests.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/mail/tests.py b/tests/mail/tests.py index e680fb165a..bc0d8eabc9 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -554,7 +554,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): 'Subject', 'UTF-8 encoded body', 'bounce@example.com', ['to@example.com'], headers={'From': 'from@example.com'}, ) - self.assertNotIn(b'Content-Transfer-Encoding: base64', msg.message().as_bytes()) + self.assertIn(b'Content-Transfer-Encoding: 7bit', msg.message().as_bytes()) # Ticket #11212 # Shouldn't use quoted printable, should detect it can represent content with 7 bit data @@ -563,7 +563,6 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): headers={'From': 'from@example.com'}, ) s = msg.message().as_bytes() - self.assertNotIn(b'Content-Transfer-Encoding: quoted-printable', s) self.assertIn(b'Content-Transfer-Encoding: 7bit', s) # Shouldn't use quoted printable, should detect it can represent content with 8 bit data @@ -572,7 +571,6 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): headers={'From': 'from@example.com'}, ) s = msg.message().as_bytes() - self.assertNotIn(b'Content-Transfer-Encoding: quoted-printable', s) self.assertIn(b'Content-Transfer-Encoding: 8bit', s) msg = EmailMessage( @@ -580,7 +578,6 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): ['to@example.com'], headers={'From': 'from@example.com'}, ) s = msg.message().as_bytes() - self.assertNotIn(b'Content-Transfer-Encoding: quoted-printable', s) self.assertIn(b'Content-Transfer-Encoding: 8bit', s) def test_dont_base64_encode_message_rfc822(self):