def test_no_match_missing_munger(self):
"""
Tests the process_email receiver for an email that doesn't match
an existing MailChute when a default MailChute is enabled but
the defaul MailMunger can't be found.
"""
doc_obj = self.doc_obj
doc_obj.data['Subject'] = 'nothing to see here'
mock_config = {
'DEFAULT_MUNGER': 'missing_munger',
'DEFAULT_MUNGER_ENABLED': True
}
with patch.dict('sifter.mailsifter.mailchutes.models.conf.MAILSIFTER',
mock_config):
with LogCapture() as log_capture:
msg = 'Default MailMunger "missing_munger" is not configured.'
MailChute.objects.process(doc_obj)
log_capture.check(
('sifter.chutes.models', 'ERROR', msg),
)
评论列表
文章目录