Fix quality failures

This commit is contained in:
Andy Armstrong
2015-01-09 15:27:17 -05:00
parent 22d65acdbf
commit f58e96a2fa
2 changed files with 5 additions and 6 deletions

View File

@@ -946,19 +946,20 @@ class TestMixedModuleStore(CourseComparisonTest):
self.assertEqual(new_parent_location, self.store.get_item(child_to_move_location).get_parent().location)
with self.store.branch_setting(ModuleStoreEnum.Branch.published_only):
self.assertEqual(old_parent_location, self.store.get_item(child_to_move_location).get_parent().location)
old_parent_published_location = old_parent_location.for_branch(ModuleStoreEnum.BranchName.published)
self.verify_get_parent_locations_results([
(child_to_move_location, new_parent_location, None),
(child_to_move_location, new_parent_location, ModuleStoreEnum.RevisionOption.draft_preferred),
(child_to_move_location, old_parent_location.for_branch(ModuleStoreEnum.BranchName.published), ModuleStoreEnum.RevisionOption.published_only),
(child_to_move_location, old_parent_published_location, ModuleStoreEnum.RevisionOption.published_only),
])
# publish the course again
self.store.publish(self.course.location, self.user_id)
new_parent_published_location = new_parent_location.for_branch(ModuleStoreEnum.BranchName.published)
self.verify_get_parent_locations_results([
(child_to_move_location, new_parent_location, None),
(child_to_move_location, new_parent_location, ModuleStoreEnum.RevisionOption.draft_preferred),
(child_to_move_location, new_parent_location.for_branch(ModuleStoreEnum.BranchName.published), ModuleStoreEnum.RevisionOption.published_only),
(child_to_move_location, new_parent_published_location, ModuleStoreEnum.RevisionOption.published_only),
])
@ddt.data('draft')

View File

@@ -358,9 +358,7 @@ def _has_group_access(descriptor, user, course_key):
# finally: check that the user has a satisfactory group assignment
# for each partition.
if not all(
user_groups.get(partition.id) in groups for partition, groups in partition_groups
):
if not all(user_groups.get(partition.id) in groups for partition, groups in partition_groups):
return False
# all checks passed.