Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import test_scheduler_error_mailer

View File

@@ -0,0 +1,32 @@
# Copyright 2023 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from unittest.mock import patch
from odoo.addons.base.tests.common import BaseCommon
from odoo.addons.scheduler_error_mailer.hooks import post_init_hook
class TestSchedulerErrorMailer(BaseCommon):
def setUp(self):
super().setUp()
self.cron = self.env.ref("scheduler_error_mailer.test_scheduler_error_mailer")
def test_error_cron(self):
with (
self.assertLogs(
"odoo.addons.scheduler_error_mailer.models.ir_cron", "DEBUG"
),
patch.object(self.env.cr, "rollback"),
):
self.cron._handle_callback_exception(
self.cron.name,
self.cron.ir_actions_server_id.id,
Exception("hello world"),
)
def test_init_hook(self):
post_init_hook(self.env)
self.assertFalse(
self.env["ir.cron"].search([("email_template_id", "=", False)])
)