A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
more tests
jonaswinklerab871d67fcb0
diff --git a/src/paperless_mail/tests/test_mail.py b/src/paperless_mail/tests/test_mail.pyindex 3cd3e8499..2a391a268 100644--- a/src/paperless_mail/tests/test_mail.py+++ b/src/paperless_mail/tests/test_mail.py@@ -384,6 +384,35 @@ class TestMail(TestCase):self.assertEqual(len(self.bogus_mailbox.messages), 1)self.assertEqual(self.bogus_mailbox.messages[0].from_, '[email protected]')+ def test_error_create_correspondent(self):++ account = MailAccount.objects.create(name="test2", imap_server="", username="admin", password="secret")+ rule = MailRule.objects.create(+ name="testrule", filter_from="[email protected]",+ account=account, action=MailRule.ACTION_MOVE, action_parameter="spam",+ assign_correspondent_from=MailRule.CORRESPONDENT_FROM_EMAIL)++ self.mail_account_handler.handle_mail_account(account)++ self.async_task.assert_called_once()+ args, kwargs = self.async_task.call_args++ c = Correspondent.objects.get(name="[email protected]")+ # should work+ self.assertEquals(kwargs['override_correspondent_id'], c.id)++ self.async_task.reset_mock()+ self.reset_bogus_mailbox()++ with mock.patch("paperless_mail.mail.Correspondent.objects.get_or_create") as m:+ m.side_effect = DatabaseError()++ self.mail_account_handler.handle_mail_account(account)++ args, kwargs = self.async_task.call_args+ self.async_task.assert_called_once()+ self.assertEquals(kwargs['override_correspondent_id'], None)+def test_filters(self):