diff options
author | Tim Graham <timograham@gmail.com> | 2017-02-17 19:45:34 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-09-25 17:11:03 -0400 |
commit | cfff2af02be40106d4759cc6f8bfa476ce82421c (patch) | |
tree | 2680ff4040dd83d7b50ca2265e8268e362142476 /tests/mail | |
parent | a80903b7114c984b5087597e8c34750e7bb44f51 (diff) | |
download | django-cfff2af02be40106d4759cc6f8bfa476ce82421c.tar.gz |
Fixed #27857 -- Dropped support for Python 3.4.
Diffstat (limited to 'tests/mail')
-rw-r--r-- | tests/mail/tests.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 29a56d6e74..b60e7ff6c9 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -61,10 +61,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): def iter_attachments(): for i in email_message.walk(): - # Once support for Python<3.5 has been dropped, we can use - # i.get_content_disposition() here instead. - content_disposition = i.get('content-disposition', '').split(';')[0].lower() - if content_disposition == 'attachment': + if i.get_content_disposition() == 'attachment': filename = i.get_filename() content = i.get_payload(decode=True) mimetype = i.get_content_type() @@ -1161,8 +1158,8 @@ class FakeSMTPServer(smtpd.SMTPServer, threading.Thread): def __init__(self, *args, **kwargs): threading.Thread.__init__(self) # New kwarg added in Python 3.5; default switching to False in 3.6. - if sys.version_info >= (3, 5): - kwargs['decode_data'] = True + # Setting a value only silences a deprecation warning in Python 3.5. + kwargs['decode_data'] = True smtpd.SMTPServer.__init__(self, *args, **kwargs) self._sink = [] self.active = False |