[fix] don't send email in test'

This commit is contained in:
Rushabh Mehta 2016-11-18 08:12:06 +05:30
parent 5bfc3f2a2e
commit f801a7c56c
2 changed files with 3 additions and 4 deletions

View file

@ -8,7 +8,7 @@ Received: from 23-59-23-10.perm.iinet.net.au ([23.59.23.10]:56280)
for test_receiver@example.com; Tue, 09 Feb 2016 14:53:22 +0800
From: <test_sender@example.com>
To: <test_receiver@example.com>
Subject: test email
Subject: test email
Date: Tue, 9 Feb 2016 14:53:13 +0800
Message-ID: <000001d16306$8b9e5c60$a2db1520$@ia-group.com.au>
MIME-Version: 1.0
@ -30,7 +30,7 @@ Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
4th test email
4th test email
------=_NextPart_001_0006_01D16349.99C37120

View file

@ -292,11 +292,10 @@ def make_cache_queue():
def send_one(email, smtpserver=None, auto_commit=True, now=False):
'''Send Email Queue with given smtpserver'''
if frappe.are_emails_muted():
if frappe.are_emails_muted() or frappe.flags.in_test:
frappe.msgprint(_("Emails are muted"))
return
email = frappe.db.sql('''select name, status, communication,
message, sender, recipient, reference_doctype
from `tabEmail Queue` where name=%s for update''', email, as_dict=True)[0]