'Test that in self-paced course, item has `live` visibility state.
Test that when item was initially in `scheduled` state in instructor mode, change course pacing to self-paced,
now in self-paced course, item should have `live` visibility state.'

@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_self_paced_item_visibility_state(self, store_type):

    SelfPacedConfiguration(enabled=True).save()
    course = CourseFactory.create(default_store=store_type)
    chapter = self._create_child(course, 'chapter', 'Test    Chapter')
    self._set_release_date(chapter.location, (datetime.now(UTC) + timedelta(days=1)))
    xblock_info = self._get_xblock_info(chapter.location)
    self._verify_visibility_state(xblock_info, VisibilityState.ready)
    self.assertFalse(course.self_paced)
    course.self_paced = True
    self.store.update_item(course, self.user.id)
    self.assertTrue(course.self_paced)
    xblock_info = self._get_xblock_info(chapter.location)
    self._verify_visibility_state(xblock_info, VisibilityState.live)
