Complete effective assignment expiry lifecycle

This commit is contained in:
2026-07-31 18:07:36 +02:00
parent d1c5738ca8
commit f025b0c25b
13 changed files with 619 additions and 59 deletions
+20
View File
@@ -233,6 +233,26 @@ class AssignmentWorkflowTests(unittest.TestCase):
lifecycle_event_types(before, after, now=now),
)
def test_reactivation_of_elapsed_assignment_emits_expiry(self) -> None:
now = datetime.now(timezone.utc)
item = assignment(
is_active=False,
valid_until=now - timedelta(minutes=1),
)
before = AssignmentSnapshot.from_assignment(item) # type: ignore[arg-type]
after = plan_assignment_update( # type: ignore[arg-type]
item,
{"is_active": True},
).after
self.assertEqual(
(
"idm.function_assignment.changed.v1",
"idm.function_assignment.expired.v1",
),
lifecycle_event_types(before, after, now=now),
)
if __name__ == "__main__":
unittest.main()