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