mirror of https://github.com/django/django.git
Removed redundant usage of assertNotIn() in a mail test.
The Content-Transfer-Encoding header won't be repeated, so checking the header is sufficient.
This commit is contained in:
parent
a3a10f8abe
commit
b2f9db1637
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue