Testing framework
=================

iw.email provide a testing framework. 

You just need to use iw.email.testing.smtpSetUp() and
iw.email.testing.smtpTearDown() in your test case.

This will patch smtplib to allow you to test email sending in your doctests
like you can see in this document.

You can also set some environment variable to also send the generated email.
Here is the allowed variable::

  TEST_MAIL: the recipient 
  TEST_MAILFROM: mail from address (default to test@ingeniweb.com)
  TEST_MAILHOST: hostname of an smtp server (default to localhost)
  TEST_MAILPORT: smtp port (default to 25)

If the TEST_MAIL is set, the testing framework will try to send emails to it.
So you just need this command if you have a local smtp server::

  $ TEST_MAIL=gael@ingeniweb.com python setup.py test

