def test_no_match_with_default(self):
"""
Tests the process_email receiver for an email that doesn't match
an existing MailChute when a default MailMunger is enabled.
"""
doc_obj = self.doc_obj
doc_obj.data['Subject'] = 'nothing to see here'
mock_config = {
'DEFAULT_MUNGER': 'default_mail',
'DEFAULT_MUNGER_ENABLED': True
}
with patch.dict('sifter.mailsifter.mailchutes.models.conf.MAILSIFTER',
mock_config):
with patch('sifter.mailsifter.mailchutes.models.MailChuteManager._process_with_default') \
as mock_default_process:
MailChute.objects.process(doc_obj)
mock_default_process.assert_called_once_with(doc_obj)
评论列表
文章目录