def _is_block_hidden(self, block_structure, block_key): """ Returns whether the block with the given block_key should be hidden, given the current time. """ due = self._get_merged_due_date(block_structure, block_key) hide_after_due = self._get_merged_hide_after_due(block_structure, block_key) return not SequenceModule.verify_current_content_visibility(due, hide_after_due)
def _is_block_hidden(self, block_structure, block_key): """ Returns whether the block with the given block_key should be hidden, given the current time. """ hide_after_due = self._get_merged_hide_after_due(block_structure, block_key) self_paced = block_structure[block_structure.root_block_usage_key].self_paced if self_paced: hidden_date = block_structure[block_structure.root_block_usage_key].end else: hidden_date = self._get_merged_due_date(block_structure, block_key) return not SequenceModule.verify_current_content_visibility(hidden_date, hide_after_due)
def test_student_view_init(self): seq_module = SequenceModule(runtime=Mock(position=2), descriptor=Mock(), scope_ids=Mock()) self.assertEquals(seq_module.position, 2) # matches position set in the runtime
def test_student_view_init(self): seq_module = SequenceModule(runtime=Mock(position=2), descriptor=Mock(), scope_ids=Mock()) assert seq_module.position == 2