Esempio n. 1
0
    def test_verify(self):
        status = Status(
            period=self.period,
            status="ready",
            message="",
            user=self.testhelper.periodadmin,
            plugin="devilry_qualifiesforexam_approved.subset",
        )
        status.save()
        relatedStudent1 = self.create_relatedstudent("student1")
        status.students.create(relatedstudent=relatedStudent1, qualifies=True)

        self.create_feedbacks(
            (self.testhelper.sub_p1_a1_gstudent1, {"grade": "F", "points": 0, "is_passing_grade": False})
        )

        with self.assertRaises(PluginResultsFailedVerification):
            post_statussave_subset(status, {"assignmentids_that_must_be_passed": [self.testhelper.sub_p1_a1.id]})
Esempio n. 2
0
 def test_save_settings(self):
     status = Status(
         period=self.period,
         status="ready",
         message="",
         user=self.testhelper.periodadmin,
         plugin="devilry_qualifiesforexam_approved.subset",
     )
     status.save()
     self.assertEqual(SubsetPluginSetting.objects.count(), 0)
     post_statussave_subset(
         status, {"assignmentids_that_must_be_passed": [self.testhelper.sub_p1_a1.id, self.testhelper.sub_p1_a2.id]}
     )
     self.assertEqual(SubsetPluginSetting.objects.count(), 1)
     settings = status.devilry_qualifiesforexam_approved_subsetpluginsetting
     self.assertEqual(settings.selectedassignment_set.count(), 2)
     ids = set([selected.assignment.id for selected in settings.selectedassignment_set.all()])
     self.assertEqual(ids, set([self.testhelper.sub_p1_a1.id, self.testhelper.sub_p1_a2.id]))