Exemple #1
0
    def test_reset_in_subs_to_ml(self):
        test_util.create_ml_model(STUDENT_ID, LOCATION)

        new_sub = test_util.get_sub("IN", STUDENT_ID, LOCATION)
        new_sub.save()

        success = expire_submissions.reset_in_subs_to_ml()

        new_sub = Submission.objects.get(id=new_sub.id)

        self.assertEqual(new_sub.next_grader_type, "ML")
        self.assertTrue(success)
Exemple #2
0
    def test_reset_in_subs_to_ml(self):
        test_util.create_ml_model(STUDENT_ID, LOCATION)

        new_sub = test_util.get_sub("IN", STUDENT_ID, LOCATION)
        new_sub.save()

        success = expire_submissions.reset_in_subs_to_ml()
        
        new_sub = Submission.objects.get(id = new_sub.id)

        self.assertEqual(new_sub.next_grader_type, "ML")
        self.assertTrue(success)
Exemple #3
0
    def test_get_ml_subs_true(self):
        test_util.create_ml_model(STUDENT_ID, LOCATION)

        #Create a submission that requires ML grading
        sub = test_util.get_sub("ML", STUDENT_ID, LOCATION)
        sub.save()

        content = self.c.get(ML_GET_URL, data={})
        body = json.loads(content.content)

        #Ensure that submission is retrieved successfully
        self.assertEqual(body['success'], True)

        sub = Submission.objects.get(id=int(body['submission_id']))
        self.assertEqual(sub.prompt, "prompt")
Exemple #4
0
    def test_get_ml_subs_true(self):
        test_util.create_ml_model(STUDENT_ID, LOCATION)

        # Create a submission that requires ML grading
        sub = test_util.get_sub("ML", STUDENT_ID, LOCATION)
        sub.save()

        content = self.c.get(ML_GET_URL, data={})
        body = json.loads(content.content)

        # Ensure that submission is retrieved successfully
        self.assertEqual(body["success"], True)

        sub = Submission.objects.get(id=int(body["submission_id"]))
        self.assertEqual(sub.prompt, "prompt")