Merge remote-tracking branch 'remotes/origin/release' into release-2015-10-01-resolve-merge-conflicts
This commit is contained in:
@@ -198,16 +198,6 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli
|
||||
branches_to_delete = [ModuleStoreEnum.BranchName.published, ModuleStoreEnum.BranchName.draft]
|
||||
elif revision is None:
|
||||
branches_to_delete = [ModuleStoreEnum.BranchName.draft]
|
||||
draft_location = location.for_branch(ModuleStoreEnum.BranchName.draft)
|
||||
try:
|
||||
item = self.get_item(draft_location)
|
||||
if getattr(item, 'has_children', False):
|
||||
# If item have has_published_version then delete published children also.
|
||||
if self.has_published_version(item):
|
||||
branches_to_delete.insert(0, ModuleStoreEnum.BranchName.published)
|
||||
except ItemNotFoundError:
|
||||
# Raises ValueError as in function description
|
||||
raise ValueError("Cannot delete a block that does not exist")
|
||||
else:
|
||||
raise UnsupportedRevisionError(
|
||||
[
|
||||
|
||||
@@ -2465,102 +2465,6 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
|
||||
# Verify that the signal was emitted
|
||||
self.assertEqual(receiver.call_count, 1)
|
||||
|
||||
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
|
||||
def test_delete_published_item_creates_no_orphans(self, default_store):
|
||||
"""
|
||||
Tests delete published item dont create any oprhans in course
|
||||
"""
|
||||
self.initdb(default_store)
|
||||
course_locator = self.course.id
|
||||
|
||||
chapter = self.store.create_child(
|
||||
self.user_id, self.course.location, 'chapter', block_id='section_one'
|
||||
)
|
||||
|
||||
sequential = self.store.create_child(
|
||||
self.user_id, chapter.location, 'sequential', block_id='subsection_one'
|
||||
)
|
||||
|
||||
vertical = self.store.create_child(
|
||||
self.user_id, sequential.location, 'vertical', block_id='moon_unit'
|
||||
)
|
||||
|
||||
problem = self.store.create_child(
|
||||
self.user_id, vertical.location, 'problem', block_id='problem'
|
||||
)
|
||||
|
||||
self.store.publish(chapter.location, self.user_id)
|
||||
# Verify that there are no changes
|
||||
self.assertFalse(self._has_changes(chapter.location))
|
||||
self.assertFalse(self._has_changes(sequential.location))
|
||||
self.assertFalse(self._has_changes(vertical.location))
|
||||
self.assertFalse(self._has_changes(problem.location))
|
||||
|
||||
# No oprhans in course
|
||||
course_orphans = self.store.get_orphans(course_locator)
|
||||
self.assertEqual(len(course_orphans), 0)
|
||||
self.store.delete_item(vertical.location, self.user_id)
|
||||
# No oprhans in course after delete
|
||||
course_orphans = self.store.get_orphans(course_locator)
|
||||
self.assertEqual(len(course_orphans), 0)
|
||||
|
||||
if default_store == ModuleStoreEnum.Type.split:
|
||||
course_locator_publish = course_locator.for_branch(ModuleStoreEnum.BranchName.published)
|
||||
# No published oprhans after delete
|
||||
course_publish_orphans = self.store.get_orphans(course_locator_publish)
|
||||
self.assertEqual(len(course_publish_orphans), 0)
|
||||
|
||||
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
|
||||
def test_delete_draft_item_creates_no_orphans(self, default_store):
|
||||
"""
|
||||
Tests delete draft item create no oprhans in course
|
||||
"""
|
||||
self.initdb(default_store)
|
||||
course_locator = self.course.id
|
||||
|
||||
chapter = self.store.create_child(
|
||||
self.user_id, self.course.location, 'chapter', block_id='section_one'
|
||||
)
|
||||
|
||||
sequential = self.store.create_child(
|
||||
self.user_id, chapter.location, 'sequential', block_id='subsection_one'
|
||||
)
|
||||
|
||||
vertical = self.store.create_child(
|
||||
self.user_id, sequential.location, 'vertical', block_id='moon_unit'
|
||||
)
|
||||
|
||||
problem = self.store.create_child(
|
||||
self.user_id, vertical.location, 'problem', block_id='problem'
|
||||
)
|
||||
|
||||
self.store.publish(chapter.location, self.user_id)
|
||||
# Verify that there are no changes
|
||||
self.assertFalse(self._has_changes(chapter.location))
|
||||
self.assertFalse(self._has_changes(sequential.location))
|
||||
self.assertFalse(self._has_changes(vertical.location))
|
||||
self.assertFalse(self._has_changes(problem.location))
|
||||
|
||||
# No oprhans in course
|
||||
course_orphans = self.store.get_orphans(course_locator)
|
||||
self.assertEqual(len(course_orphans), 0)
|
||||
|
||||
problem.display_name = 'changed'
|
||||
problem = self.store.update_item(problem, self.user_id)
|
||||
self.assertTrue(self._has_changes(vertical.location))
|
||||
self.assertTrue(self._has_changes(problem.location))
|
||||
|
||||
self.store.delete_item(vertical.location, self.user_id)
|
||||
# No oprhans in course after delete
|
||||
course_orphans = self.store.get_orphans(course_locator)
|
||||
self.assertEqual(len(course_orphans), 0)
|
||||
|
||||
if default_store == ModuleStoreEnum.Type.split:
|
||||
course_locator_publish = course_locator.for_branch(ModuleStoreEnum.BranchName.published)
|
||||
# No published oprhans after delete
|
||||
course_publish_orphans = self.store.get_orphans(course_locator_publish)
|
||||
self.assertEqual(len(course_publish_orphans), 0)
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
@attr('mongo')
|
||||
|
||||
@@ -729,7 +729,7 @@ class TestProctoringRendering(ModuleStoreTestCase):
|
||||
{
|
||||
'status': 'eligible',
|
||||
'short_description': 'Ungraded Practice Exam',
|
||||
'suggested_icon': 'fa-pencil-square-o',
|
||||
'suggested_icon': '',
|
||||
'in_completed_state': False
|
||||
}
|
||||
),
|
||||
|
||||
@@ -58,7 +58,7 @@ git+https://github.com/edx/edx-lint.git@c5745631d2eee4e2efe8c31fa7b42fe2c12a0755
|
||||
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
|
||||
-e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client
|
||||
git+https://github.com/edx/edx-organizations.git@release-2015-09-22#egg=edx-organizations==0.1.6
|
||||
git+https://github.com/edx/edx-proctoring.git@0.9.11#egg=edx-proctoring==0.9.11
|
||||
git+https://github.com/edx/edx-proctoring.git@0.9.14#egg=edx-proctoring==0.9.14
|
||||
|
||||
# Third Party XBlocks
|
||||
-e git+https://github.com/mitodl/edx-sga@172a90fd2738f8142c10478356b2d9ed3e55334a#egg=edx-sga
|
||||
|
||||
Reference in New Issue
Block a user