def METHOD_NAME(self):
    schedule_modules = (module for module in self.modules
                        if getattr(module, 'has_schedule', False) and module.all_forms_require_a_case)
    schedule_phases = (phase for module in schedule_modules for phase in module.get_schedule_phases())
    schedule_forms = (form for phase in schedule_phases for form in phase.get_forms())
    for form in schedule_forms:
        schedule = form.schedule
        if schedule is None:
            raise ScheduleError(_("There is no schedule for form {form_id}").format(form_id=form.unique_id))
        visits = [ScheduleFixtureVisit(id=visit.id,
                                       due=visit.due,
                                       starts=visit.starts,
                                       expires=visit.expires,
                                       repeats=visit.repeats,
                                       increment=visit.increment)
                  for visit in schedule.get_visits()]
        schedule_fixture = ScheduleFixture(
            id=id_strings.schedule_fixture(form.get_module(), form.get_phase(), form),
            schedule=Schedule(
                starts=schedule.starts,
                expires=schedule.expires if schedule.expires else '',
                allow_unscheduled=schedule.allow_unscheduled,
                visits=visits,
            )
        )
        yield schedule_fixture