Commit d3fc2625 by Mushtaq Ali

Code refactor pass store_type in course create method

parent 3559bd1e
...@@ -2181,22 +2181,21 @@ class TestXBlockPublishingInfo(ItemTest): ...@@ -2181,22 +2181,21 @@ class TestXBlockPublishingInfo(ItemTest):
""" """
SelfPacedConfiguration(enabled=True).save() SelfPacedConfiguration(enabled=True).save()
with self.store.default_store(store_type): # Create course, chapter and setup future release date to make chapter in scheduled state
# Create course, chapter and setup future release date to make chapter in scheduled state course = CourseFactory.create(default_store=store_type)
course = CourseFactory.create() chapter = self._create_child(course, 'chapter', "Test Chapter")
chapter = self._create_child(course, 'chapter', "Test Chapter") self._set_release_date(chapter.location, datetime.now(UTC) + timedelta(days=1))
self._set_release_date(chapter.location, datetime.now(UTC) + timedelta(days=1))
# Check that chapter has scheduled state
# Check that has scheduled state xblock_info = self._get_xblock_info(chapter.location)
xblock_info = self._get_xblock_info(chapter.location) self._verify_visibility_state(xblock_info, VisibilityState.ready)
self._verify_visibility_state(xblock_info, VisibilityState.ready) self.assertFalse(course.self_paced)
self.assertFalse(course.self_paced)
# Change course pacing to self paced
# Change course pacing to self paced course.self_paced = True
course.self_paced = True self.store.update_item(course, self.user.id)
self.store.update_item(course, self.user.id) self.assertTrue(course.self_paced)
self.assertTrue(course.self_paced)
# Check that in self paced course content has live state now
# Check that in self paced course content has live state now xblock_info = self._get_xblock_info(chapter.location)
xblock_info = self._get_xblock_info(chapter.location) self._verify_visibility_state(xblock_info, VisibilityState.live)
self._verify_visibility_state(xblock_info, VisibilityState.live)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment