mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Removed unnecessary str() in mail tests.
Unnecessary since their introduction in
fa75b2cb51
.
This commit is contained in:
parent
ec9d0123e0
commit
ec594942cd
@ -1144,7 +1144,7 @@ class ConsoleBackendTests(BaseEmailBackendTests, SimpleTestCase):
|
|||||||
|
|
||||||
def get_mailbox_content(self):
|
def get_mailbox_content(self):
|
||||||
messages = self.stream.getvalue().split('\n' + ('-' * 79) + '\n')
|
messages = self.stream.getvalue().split('\n' + ('-' * 79) + '\n')
|
||||||
return [message_from_bytes(str(m).encode()) for m in messages if m]
|
return [message_from_bytes(m.encode()) for m in messages if m]
|
||||||
|
|
||||||
def test_console_stream_kwarg(self):
|
def test_console_stream_kwarg(self):
|
||||||
"""
|
"""
|
||||||
@ -1153,7 +1153,7 @@ class ConsoleBackendTests(BaseEmailBackendTests, SimpleTestCase):
|
|||||||
s = StringIO()
|
s = StringIO()
|
||||||
connection = mail.get_connection('django.core.mail.backends.console.EmailBackend', stream=s)
|
connection = mail.get_connection('django.core.mail.backends.console.EmailBackend', stream=s)
|
||||||
send_mail('Subject', 'Content', 'from@example.com', ['to@example.com'], connection=connection)
|
send_mail('Subject', 'Content', 'from@example.com', ['to@example.com'], connection=connection)
|
||||||
message = str(s.getvalue().split('\n' + ('-' * 79) + '\n')[0]).encode()
|
message = s.getvalue().split('\n' + ('-' * 79) + '\n')[0].encode()
|
||||||
self.assertMessageHasHeaders(message, {
|
self.assertMessageHasHeaders(message, {
|
||||||
('MIME-Version', '1.0'),
|
('MIME-Version', '1.0'),
|
||||||
('Content-Type', 'text/plain; charset="utf-8"'),
|
('Content-Type', 'text/plain; charset="utf-8"'),
|
||||||
|
Loading…
Reference in New Issue
Block a user