Skip to content

Commit 7b5de7e

Browse files
test(spp_cel_event): cover the _execute_plan passthrough
Event tests early-return on event nodes and plain plans take the SQL path, so the override's super() passthrough (the as_root thread-through) was the one uncovered changed line on the PR. Drive a LeafDomain plan through the override both with and without as_root. Suite: spp_cel_event 171.
1 parent 328ca85 commit 7b5de7e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

spp_cel_event/tests/test_cel_event_integration.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,3 +1258,20 @@ def test_compute_aggregation_dict_dispatch(self):
12581258
self.assertEqual(executor._compute_aggregation(events, "count", None), 2)
12591259
# Unknown agg type returns 0
12601260
self.assertEqual(executor._compute_aggregation(events, "unknown_agg", "score"), 0)
1261+
1262+
1263+
@tagged("post_install", "-at_install")
1264+
class TestEventExecutorPassthrough(TransactionCase):
1265+
"""Non-event plan nodes fall through the event executor's _execute_plan
1266+
override to the base implementation (with the as_root parameter intact)."""
1267+
1268+
def test_non_event_plan_falls_through_to_base(self):
1269+
from odoo.addons.spp_cel_domain.models.cel_queryplan import LeafDomain
1270+
1271+
partner = self.env["res.partner"].create(
1272+
{"name": "Passthrough Person", "is_registrant": True, "is_group": False}
1273+
)
1274+
plan = LeafDomain(model="res.partner", domain=[("id", "=", partner.id)])
1275+
executor = self.env["spp.cel.executor"]
1276+
self.assertEqual(executor._execute_plan("res.partner", plan), [partner.id])
1277+
self.assertEqual(executor._execute_plan("res.partner", plan, as_root=True), [partner.id])

0 commit comments

Comments
 (0)