summaryrefslogtreecommitdiff
path: root/tests/mail
Commit message (Collapse)AuthorAgeFilesLines
* Updated documentation and comments for RFC updates.Nick Pope2022-11-101-2/+2
| | | | | | | | | | | | | | | - Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
* Refs #33173 -- Fixed MailTests.test_backend_arg() on Windows and Python 3.11+.David Smith2022-02-191-1/+2
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-8/+15
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-073-579/+939
|
* Refs #32074 -- Removed usage of deprecated asyncore and smtpd modules.Mariusz Felisiak2021-10-151-82/+56
| | | asyncore and smtpd modules were deprecated in Python 3.10.
* Refs #27131 -- Removed SMTPBackendTests.test_server_login().Mariusz Felisiak2021-10-141-38/+1
| | | | | | | test_server_login() was a regression test for a crash when passing Unicode strings to SMTP server using CRAM-MD5 method on Python 2. Python 2 is no longer supported and test_server_login() passes even without FakeSMTPChannel.smtp_AUTH() because smtplib.SMTPAuthenticationError is raised when AUTH is not implemented.
* Refs #32355 -- Used addClassCleanup() in tests.Mariusz Felisiak2021-06-041-6/+2
| | | Inspired by Adam Johnson talk on DjangoCon Europe 2021.
* Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.core.Daniyal2021-03-191-0/+26
|
* Used mock.Mock() in SMTPBackendTests.Konstantin Alekseev2020-08-071-4/+4
| | | | Using bool caused mypy typecheck failures.
* Fixed #31784 -- Fixed crash when sending emails on Python 3.6.11+, 3.7.8+, ↵Florian Apolloner2020-07-201-6/+44
| | | | | | | | | | | | | | | and 3.8.4+. Fixed sending emails crash on email addresses with display names longer then 75 chars on Python 3.6.11+, 3.7.8+, and 3.8.4+. Wrapped display names were passed to email.headerregistry.Address() what caused raising an exception because address parts cannot contain CR or LF. See https://bugs.python.org/issue39073 Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Refs #31784 -- Added test for preventing header injection in display name of ↵Mariusz Felisiak2020-07-201-2/+10
| | | | email addresses.
* Capitalized Unicode in docs, strings, and comments.Jon Dufresne2020-04-201-1/+1
|
* Adjusted expected exception message for Windows.Jon Dufresne2019-11-061-1/+4
| | | | | | Test failure introduced in fbbff7f80870bc3e98de4a2fc9cd853949842fd0. Windows uses a different error message when a non-path is passed to os.path functions.
* Refs #29983 -- Added pathlib.Path support to the file email backend.Jon Dufresne2019-11-061-1/+15
|
* Fixed #30608 -- Fixed non-unicode EmailMessage crash when domain name for ↵Chason Chaffin2019-07-031-1/+9
| | | | | | localhost is non-ASCII. Assisted by felixxm.
* Fixed #30604 -- Made mail_admins()/mail_managers() raise ValueError if ↵Hasan Ramezani2019-07-021-0/+17
| | | | ADMINS/MANAGERS is set incorrectly.
* Refs #30512, #15042 -- Added local-only address to sanitize_email() tests cases.Carlton Gibson2019-06-131-0/+1
| | | | | | | | | | email.headerregistry.parser.get_mailbox() returns a token with a `token_type` attribute. If `token_type` is `’invalid-mailbox’` then RFC violations have been detected. Emails with only the local part, and no domain, are correctly parsed but are marked as `’invalid-mailbox’`. As per #15042, local-only are supported, to enable sending to addresses on localhost. sanitize_email() does not currently check `token_type`. This test is added to avoid a regression in case this is revisited in the future.
* Fixed #30512 -- Used email.headerregistry.parser for parsing emails in ↵Joachim Jablon2019-06-131-0/+20
| | | | sanitize_address().
* Refs #30512 -- Added tests for sanitizing email addresses with display name ↵Joachim Jablon2019-06-061-0/+25
| | | | and two @ signs.
* Refs #30512 -- Used subTest() in MailTests.test_sanitize_address.Joachim Jablon2019-06-061-26/+21
|
* Removed uneeded generator expressions and list comprehensions.Sergey Fedoseev2019-02-091-2/+2
|
* Fixed #30116 -- Dropped support for Python 3.5.Tim Graham2019-01-301-4/+1
|
* Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne2019-01-281-2/+1
| | | | Used more specific errors (e.g. FileExistsError) as appropriate.
* Used 4 space hanging indent for dictionaries.Tim Graham2019-01-021-3/+7
| | | Thanks Mariusz Felisiak for auditing.
* Fixed #30058 -- Made SMTP EmailBackend.send_messages() return 0 for ↵Denis Stebunov2018-12-261-1/+6
| | | | empty/error cases.
* Fixed #29830 -- Fixed loss of custom utf-8 body encoding in mails.jannschu2018-10-221-1/+16
|
* Removed unnecessary str() in mail tests.Tim Graham2018-08-041-2/+2
| | | | | Unnecessary since their introduction in fa75b2cb512409116b6f1b5229d6f99074d8e452.
* Fixed hanging indentation in various code.Mariusz Felisiak2018-03-161-3/+6
|
* Fixed #29140 -- Fixed EmailMessage crash when body is None.Williams Mendez2018-02-201-0/+5
|
* Refs #27795 -- Removed force_bytes/text() usage in tests.Tim Graham2018-02-071-5/+4
|
* Added a few tests for smtp EmailBackend.Mads Jensen2018-01-151-2/+24
|
* Fixed #28912 -- Made EmailMessage.message() omit an empty To header.Jon Dufresne2017-12-301-0/+4
|
* Fixed #28971 -- Made EmailMessage.message() set Cc from headers dict if it ↵Jon Dufresne2017-12-301-0/+7
| | | | exists.
* Tested passing To/Cc/Reply-To in EmailMessage(headers=...) without the ↵Jon Dufresne2017-12-291-0/+21
| | | | corresponding argument.
* Fixed #27857 -- Dropped support for Python 3.4.Tim Graham2017-09-251-6/+3
|
* Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham2017-09-071-4/+5
| | | | This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
* Fixed #26344 -- Made EmailMessage include alternatives when the body is ↵Igor Tokarev2017-09-041-0/+11
| | | | empty and it has attachments.
* Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen2017-06-281-5/+4
|
* Fixed #28042 -- Fixed crash when using a two-tuple in EmailMessage's ↵kalombo2017-04-071-0/+7
| | | | attachments arg.
* Tested EmailMessage(attachments=[MIMEText])kalombo2017-04-071-0/+6
|
* Fixed #27848 -- Prevented crash when attaching a .eml file to a messageClaude Paroz2017-04-012-0/+45
| | | | Thanks Sébastien Ramage for the report.
* Refs #27795 -- Removed unneeded force_text callsClaude Paroz2017-03-041-2/+0
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode().Tim Graham2017-02-091-2/+2
|
* Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz2017-02-071-5/+5
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Replaced tempfile.mkdtemp() with TemporaryDirectory() context ↵Chillar Anand2017-01-261-4/+1
| | | | manager.
* Refs #23919 -- Removed misc Python 2/3 references.Tim Graham2017-01-251-3/+2
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-252-12/+12
|
* Refs #23919 -- Removed unneeded str() callsClaude Paroz2017-01-201-10/+10
|
* Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham2017-01-201-2/+1
| | | These functions do nothing on Python 3.
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-2/+2
|