test(calendar): commit retirement before engine inspection

This commit is contained in:
2026-07-22 03:21:20 +02:00
parent 041e2159e7
commit bf59cd830c

View File

@@ -828,6 +828,11 @@ class CalDAVSyncTests(unittest.TestCase):
assert plan.destroy_data_executor is not None
with patch("govoplan_calendar.backend.service.audit_event") as audit:
plan.destroy_data_executor(session, "calendar")
# Retirement intentionally participates in the caller's database
# transaction. Commit before inspecting through a new Engine
# connection; otherwise SQLite rolls back the uncommitted DDL when
# the temporary inspector connection is returned to the pool.
session.commit()
self.assertEqual(provider.deleted, [provider_ref])
self.assertEqual(provider.values, {})