Commit 143fe3ac by muzaffaryousaf

Adding the test for assessing cancelled submission.

TNL-900
parent bac7e995
...@@ -1337,14 +1337,35 @@ class TestPeerApi(CacheResetTest): ...@@ -1337,14 +1337,35 @@ class TestPeerApi(CacheResetTest):
jane_assessments = peer_api.get_assessments(jane_sub['uuid'], scored_only=False) jane_assessments = peer_api.get_assessments(jane_sub['uuid'], scored_only=False)
self.assertEqual(0, len(jane_assessments)) self.assertEqual(0, len(jane_assessments))
def test_get_submission_to_assess_no_workflow(self): def test_get_submission_to_assess_no_workflow(self):
# Try to retrieve a submission to assess when the student # Try to retrieve a submission to assess when the student
# doing the assessment hasn't yet submitted. # doing the assessment hasn't yet submitted.
with self.assertRaises(peer_api.PeerAssessmentWorkflowError): with self.assertRaises(peer_api.PeerAssessmentWorkflowError):
peer_api.get_submission_to_assess("no_such_submission", "scorer ID") peer_api.get_submission_to_assess("no_such_submission", "scorer ID")
def test_get_submission_to_assess_but_cancelled(self):
buffy_sub, buffy = self._create_student_and_submission("Buffy", "Buffy's answer")
xander_sub, xander = self._create_student_and_submission("Xander", "Xander's answer")
# Check for a workflow for Buffy.
buffy_workflow = PeerWorkflow.get_by_submission_uuid(buffy_sub['uuid'])
self.assertIsNotNone(buffy_workflow)
# Buffy is going to review Xander's submission, so create a workflow
# item for Buffy.
PeerWorkflow.create_item(buffy_workflow, xander_sub["uuid"])
# Cancel the Xander's submission.
xander_workflow = PeerWorkflow.get_by_submission_uuid(xander_sub['uuid'])
PeerWorkflowCancellation.create(
workflow=xander_workflow, comments='Cancellation reason', cancelled_by_id=buffy['student_id']
)
# Check to see if Buffy is able to review Xander's submission.
# She isn't able to get the submission to assess.
item = peer_api.get_submission_to_assess(buffy_sub['uuid'], 1)
self.assertIsNone(item)
def test_too_many_assessments_counted_in_score_bug(self): def test_too_many_assessments_counted_in_score_bug(self):
# This bug allowed a score to be calculated using more # This bug allowed a score to be calculated using more
# assessments, than the required number in the problem definition. # assessments, than the required number in the problem definition.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment