Finally get the mail system during automated test to send the real

message (i.e. pretend to do) instead of sending a copy, should make it
a bit easier to write tests
 - Legacy-Id: 3595
This commit is contained in:
Ole Laursen 2011-11-08 11:48:57 +00:00
parent db3c4d4c8d
commit f7eefe8ee2
2 changed files with 3 additions and 1 deletions

View file

@ -184,7 +184,8 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=N
copy_to = "ietf.tracker.archive+%s@gmail.com" % settings.SERVER_MODE
if bcc:
msg['X-Tracker-Bcc']=bcc
copy_email(msg, copy_to)
if not test_mode: # if we're running automated tests, this copy is just annoying
copy_email(msg, copy_to)
def send_mail_preformatted(request, preformatted):
"""Parse preformatted string containing mail with From:, To:, ...,

View file

@ -90,5 +90,6 @@ def run_tests(*args, **kwargs):
raise EnvironmentError("Refusing to run tests on core3")
import ietf.utils.mail
ietf.utils.mail.send_smtp = test_send_smtp
ietf.utils.mail.test_mode = True
run_tests_1(*args, **kwargs)