示例#1
0
 def test_gating_disabled(self, mock_evaluate):
     """ Test evaluate_prerequisite is not called when course.enable_subsection_gating is False """
     handle_score_changed(sender=None,
                          points_possible=1,
                          points_earned=1,
                          user_id=self.user.id,
                          course_id=unicode(self.course.id),
                          usage_id=unicode(self.test_usage_key))
     mock_evaluate.assert_not_called()
示例#2
0
 def test_gating_disabled(self, mock_evaluate):
     """ Test evaluate_prerequisite is not called when course.enable_subsection_gating is False """
     handle_score_changed(
         sender=None,
         points_possible=1,
         points_earned=1,
         user=self.user,
         course_id=unicode(self.course.id),
         usage_id=unicode(self.test_usage_key)
     )
     mock_evaluate.assert_not_called()
示例#3
0
 def test_gating_enabled(self, mock_evaluate):
     """ Test evaluate_prerequisite is called when course.enable_subsection_gating is True """
     self.course.enable_subsection_gating = True
     modulestore().update_item(self.course, 0)
     handle_score_changed(sender=None,
                          points_possible=1,
                          points_earned=1,
                          user_id=self.user.id,
                          course_id=unicode(self.course.id),
                          usage_id=unicode(self.test_usage_key))
     mock_evaluate.assert_called_with(self.course, self.course,
                                      self.user.id)  # pylint: disable=no-member
示例#4
0
 def test_gating_enabled(self, mock_evaluate):
     """ Test evaluate_prerequisite is called when course.enable_subsection_gating is True """
     self.course.enable_subsection_gating = True
     modulestore().update_item(self.course, 0)
     handle_score_changed(
         sender=None,
         points_possible=1,
         points_earned=1,
         user=self.user,
         course_id=unicode(self.course.id),
         usage_id=unicode(self.test_usage_key)
     )
     mock_evaluate.assert_called_with(self.course, self.test_usage_key, self.user.id)  # pylint: disable=no-member