I just wanted to check that what I'm seeing is actually an error
before submitting a ticket:

The SMTPConnection's send_messages method in django.core.mail returns
the number of mails sent on success, whereas the TestSMTPConnection
class in django.test.utils.py does not:

    def send_messages(self, messages):
        "Redirect messages to the dummy outbox"
        mail.outbox.extend(messages)

If your view actually uses the value of Email.send() (to which the
SMTPConnection.send_messages return value is propagated), then it will
work fine normally, but not through the test framework.

Adding:
        return len(messages)
to the TestSMTPConnection's send_messages method fixes the issue, but
maybe there's a reason I'm not aware of for not doing so in the test
framework?

-Michael


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to