Example #1
0
 def test_outcome_with_outdated_version(self):
     self.assignment.version_number = 2
     self.assignment.save()
     tasks.send_composite_outcome(
         self.user.id, unicode(self.course_key), self.assignment.id, 1
     )
     self.assertEqual(self.course_grade_mock.call_count, 0)
Example #2
0
 def test_outcome_with_score_score(self, earned, possible, expected):
     self.weighted_scores.score_for_module = MagicMock(
         return_value=(earned, possible))
     tasks.send_composite_outcome(self.user.id, unicode(self.course_key),
                                  self.assignment.id, 1)
     self.send_score_update_mock.assert_called_once_with(
         self.assignment, expected)
Example #3
0
 def test_outcome_with_outdated_version(self):
     self.assignment.version_number = 2
     self.assignment.save()
     tasks.send_composite_outcome(
         self.user.id, unicode(self.course_key), self.assignment.id, 1  # pylint: disable=no-member
     )
     self.assertEqual(self.weighted_scores_mock.call_count, 0)
Example #4
0
 def test_outcome_with_score_score(self, earned, possible, expected):
     """
     TODO: Figure out why this was failing on Jenkins
     """
     self.course_grade.score_for_module = MagicMock(return_value=(earned, possible))
     tasks.send_composite_outcome(
         self.user.id, unicode(self.course_key), self.assignment.id, 1
     )
     self.send_score_update_mock.assert_called_once_with(self.assignment, expected)
Example #5
0
 def test_outcome_with_score_score(self, earned, possible, expected):
     """
     TODO: Figure out why this was failing on Jenkins
     """
     self.course_grade.score_for_module = MagicMock(return_value=(earned, possible))
     tasks.send_composite_outcome(
         self.user.id, unicode(self.course_key), self.assignment.id, 1
     )
     self.send_score_update_mock.assert_called_once_with(self.assignment, expected)
Example #6
0
 def test_outcome_with_outdated_version(self):
     self.assignment.version_number = 2
     self.assignment.save()
     tasks.send_composite_outcome(
         self.user.id,
         unicode(self.course_key),
         self.assignment.id,
         1  # pylint: disable=no-member
     )
     self.assertEqual(self.weighted_scores_mock.call_count, 0)
Example #7
0
 def test_outcome_with_score_score(self, earned, possible, expected):
     self.course_grade.score_for_module = MagicMock(return_value=(earned, possible))
     tasks.send_composite_outcome(
         self.user.id, six.text_type(self.course_key), self.assignment.id, 1
     )
     self.send_score_update_mock.assert_called_once_with(self.assignment, expected)
Example #8
0
 def test_outcome_with_score_score(self, earned, possible, expected):
     self.weighted_scores.score_for_module = MagicMock(return_value=(earned, possible))
     tasks.send_composite_outcome(
         self.user.id, unicode(self.course_key), self.assignment.id, 1  # pylint: disable=no-member
     )
     self.send_score_update_mock.assert_called_once_with(self.assignment, expected)