Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eEmailMessage.send() errors wtih emark.backends.ConsoleEmailBackend` #54

Closed
amureki opened this issue Aug 22, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@amureki
Copy link
Member

amureki commented Aug 22, 2023

Failing test case:

    @pytest.mark.django_db
    def test_send__native_email(self):
        with io.StringIO() as stream:
            backend = backends.ConsoleEmailBackend(stream=stream)
            EmailMessage(
                to=["peter.parker@avengers.com"],
                connection=backend,
            ).send()

        assert Send.objects.count() == 1

Traceback:

tests/test_backends.py:70: in test_send__native_email
    ).send()
.direnv/python-3.11.0/lib/python3.11/site-packages/django/core/mail/message.py:298: in send
    return self.get_connection(fail_silently).send_messages([self])
emark/backends.py:23: in send_messages
    return super().send_messages(email_messages)
.direnv/python-3.11.0/lib/python3.11/site-packages/django/core/mail/backends/console.py:36: in send_messages
    self.write_message(message)
emark/backends.py:77: in write_message
    msg.set_payload(msg.get_payload(0))
../../../.pyenv/versions/3.11.0/lib/python3.11/email/message.py:287: in get_payload
    raise TypeError('Expected list, got %s' % type(self._payload))
E   TypeError: Expected list, got <class 'str'>
@amureki amureki added the bug Something isn't working label Aug 22, 2023
amureki added a commit that referenced this issue Aug 22, 2023
amureki added a commit that referenced this issue Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant