Skip to content
Snippets Groups Projects
Commit dc732308 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Allow iterating through the stage

parent 14325fe2
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,11 @@ class TestStageCreation(SimpleTestCase):
self.assertEqual(stage.form, form)
self.assertEqual(stage.phases, phases)
def test_can_iterate_through_phases(self):
stage = StageFactory()
for phase, check in zip(stage, stage.phases):
self.assertEqual(phase, check)
class TestPhaseCreation(SimpleTestCase):
def test_can_create_phase(self):
......
......@@ -31,6 +31,9 @@ class Stage:
self.form = form
self.phases = phases
def __iter__(self) -> Iterator['Phase']:
yield from self.phases
class Phase:
def __init__(self, name: str) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment