def test_process_no_sieve(self):
"""
Tests the process method for a chute with no sieve.
"""
mock_doc_id = 1
email = {'Message-ID': 'abc', 'Subject': 'This is an Urgent Alert'}
doc_obj = DocumentObj(data=email)
mailchute = MailChute.objects.get(pk=3)
mailchute.enabled = True
mailchute.munger.process = Mock(return_value=mock_doc_id)
doc_id = mailchute.process(doc_obj)
mailchute.munger.process.assert_called_once_with(doc_obj)
self.assertEqual(doc_id, mock_doc_id)
# NOTE: use TransactionTestCase to handle threading
评论列表
文章目录