Skip to content
Snippets Groups Projects
Unverified Commit 787649ba authored by jawad khan's avatar jawad khan Committed by GitHub
Browse files

LEARNER-8158 - Fixed descendants typo and added tests

LEARNER-8158 
Fixed descendants typo and added tests
parent 58971614
Branches
Tags
No related merge requests found
......@@ -465,3 +465,15 @@ class TestBlocksInCourseView(TestBlocksView, CompletionWaffleTestMixin): # pyli
})
for block_id in self.non_orphaned_block_usage_keys:
assert response.data['blocks'][block_id].get('completion')
def test_completion_all_course_with_nav_depth(self):
# when we include nav_depth we get descendants in parent nodes
for block in self.non_orphaned_raw_block_usage_keys:
submit_completions_for_testing(self.user, [block])
response = self.verify_response(params={
'depth': 'all',
'nav_depth': 3,
'requested_fields': ['completion'],
})
for block_id in self.non_orphaned_block_usage_keys:
assert response.data['blocks'][block_id].get('completion')
......@@ -346,7 +346,7 @@ def recurse_mark_complete(block_id, blocks):
if block.get('completion') == 1:
return
child_blocks = block.get('children', block.get('descendents'))
child_blocks = block.get('children', block.get('descendants'))
# Unit blocks(blocks with no children) completion is being marked by patch call to completion service.
if child_blocks:
for child_block in child_blocks:
......
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