On Feb 18, 10:27 am, Bruno Desthuilliers <bruno. 42.desthuilli...@websiteburo.invalid> wrote:
> you could just mock the send_mail > function to test that your app does send the appropriate mail - which is > what you really want to know. That's essentially what I think I am doing. I need to send a relatively complex email, multipart, with both a plain text and html versions of a message, and some attachments. I am worried that the email would fail to get out for some reason (say, attaching the html message fails), so I want to test it. I started out with a simple email, thinking to get unit tests working and then as I add stuff to the email I'd run the tests to see if it broke anything. I could mock the send_mail function by having it print to the screen "mail sent" or I could have a unit test that looked for the mail. I did the first, and it worked fine. I thought to do the second, starting with a unit test checking simply that the message got to the mailbox. But I am unable to check that, as described in the original message. Jim -- http://mail.python.org/mailman/listinfo/python-list