Skip to content

Commit e0ff3c6

Browse files
committed
test(spp_studio_events): cover is_studio_event_type computed field
1 parent cbc1d29 commit e0ff3c6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

spp_studio_events/tests/test_create_event_wizard_integration.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,26 @@ def test_studio_wizard_has_dynamic_fields(self):
156156
field_name = f"x_evt_{test_field.technical_name}"
157157
self.assertIn(field_name, studio_wizard._fields)
158158

159+
def test_is_studio_event_type_flag(self):
160+
"""Test the is_studio_event_type computed field that drives step-1 UX."""
161+
# Studio-backed event type → flag is True
162+
wizard = self.env["spp.create.event.wizard"].create(
163+
{
164+
"partner_id": self.registrant.id,
165+
"event_type_id": self.event_type.id,
166+
"collection_date": date.today(),
167+
}
168+
)
169+
self.assertTrue(wizard.is_studio_event_type)
170+
171+
# Switching to a non-Studio event type → flag flips to False
172+
wizard.event_type_id = self.regular_event_type
173+
self.assertFalse(wizard.is_studio_event_type)
174+
175+
# Clearing the event type → flag is False
176+
wizard.event_type_id = False
177+
self.assertFalse(wizard.is_studio_event_type)
178+
159179
def test_inactive_studio_type_does_not_redirect(self):
160180
"""Test that inactive Studio types don't trigger redirect."""
161181
# Deactivate the Studio event type

0 commit comments

Comments
 (0)