UPD: dav_base: tests!

This commit is contained in:
2019-03-12 18:13:19 +01:00
parent c38cc0d6e5
commit b246a785b7
11 changed files with 432 additions and 45 deletions

View File

@@ -48,7 +48,7 @@ class AbstractMail(object):
def _get_reply_to(self):
return None
def send(self):
def send(self, fail_silently=False):
subject = self._get_subject()
body = self._get_body()
sender = self._get_sender()
@@ -56,5 +56,8 @@ class AbstractMail(object):
reply_to = self._get_reply_to()
email = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients, reply_to=reply_to)
logger.info(u'Send %s to %s', self.__class__.__name__, recipients)
email.send()
if fail_silently:
logger.info(u'Fake sending %s to %s', self.__class__.__name__, recipients)
else:
logger.info(u'Send %s to %s', self.__class__.__name__, recipients)
email.send(fail_silently=fail_silently)