diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-04 08:08:27 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
commit | 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch) | |
tree | fa50869f5614295f462d9bf77fec59365c621609 /tests/mail | |
parent | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff) | |
download | django-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz |
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/mail')
-rw-r--r-- | tests/mail/tests.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 309be47059..51e26cc6be 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -295,8 +295,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): Test for space continuation character in long (ASCII) subject headers (#7747) """ email = EmailMessage( - "Long subject lines that get wrapped should contain a space " - "continuation character to get expected behavior in Outlook and Thunderbird", + "Long subject lines that get wrapped should contain a space continuation " + "character to get expected behavior in Outlook and Thunderbird", "Content", "from@example.com", ["to@example.com"], @@ -367,7 +367,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): email.to, ["list-subscriber@example.com", "list-subscriber2@example.com"] ) - # If we don't set the To header manually, it should default to the `to` argument to the constructor + # If we don't set the To header manually, it should default to the `to` + # argument to the constructor. email = EmailMessage( "Subject", "Content", @@ -558,7 +559,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): ) self.assertEqual(message.get_payload(), "Firstname S=FCrname is a great guy.") - # Make sure MIME attachments also works correctly with other encodings than utf-8 + # MIME attachments works correctly with other encodings than utf-8. text_content = "Firstname Sürname is a great guy." html_content = "<p>Firstname Sürname is a <strong>great</strong> guy.</p>" msg = EmailMultiAlternatives( @@ -790,7 +791,10 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): ) if sys.platform == "win32": - msg = "_getfullpathname: path should be string, bytes or os.PathLike, not object" + msg = ( + "_getfullpathname: path should be string, bytes or os.PathLike, not " + "object" + ) else: msg = "expected str, bytes or os.PathLike object, not object" with self.assertRaisesMessage(TypeError, msg): @@ -871,7 +875,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): 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 + # Shouldn't use quoted printable, should detect it can represent + # content with 7 bit data. msg = EmailMessage( "Subject", "Body with only ASCII characters.", @@ -882,7 +887,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): s = msg.message().as_bytes() self.assertIn(b"Content-Transfer-Encoding: 7bit", s) - # Shouldn't use quoted printable, should detect it can represent content with 8 bit data + # Shouldn't use quoted printable, should detect it can represent + # content with 8 bit data. msg = EmailMessage( "Subject", "Body with latin characters: àáä.", @@ -1182,7 +1188,8 @@ class BaseEmailBackendTests(HeadersCheckMixin): def get_mailbox_content(self): raise NotImplementedError( - "subclasses of BaseEmailBackendTests must provide a get_mailbox_content() method" + "subclasses of BaseEmailBackendTests must provide a get_mailbox_content() " + "method" ) def flush_mailbox(self): |