Commit d633e1d9 by Eric Fischer

Add new test case

parent d4a4e290
......@@ -15,6 +15,7 @@ from openassessment.assessment.models import StudentTrainingWorkflow
import submissions.api as sub_api
from openassessment.assessment.api import peer as peer_api
from openassessment.assessment.api import self as self_api
from openassessment.assessment.api import staff as staff_api
from openassessment.workflow.models import AssessmentWorkflow, AssessmentApiLoadError
from openassessment.workflow.errors import AssessmentWorkflowInternalError
......@@ -254,6 +255,39 @@ class TestAssessmentWorkflowApi(CacheResetTest):
submission = sub_api.create_submission(ITEM_1, ANSWER_2)
workflow_api.create_workflow(submission["uuid"], ["peer", "self"], ON_INIT_PARAMS)
@patch.object(staff_api, 'get_score')
@patch.object(PeerWorkflow.objects, 'get')
def test_no_peer_assessment_error_handled(self, mock_get_workflow, mock_get_staff_score):
"""
Tests to verify that, given a problem that requires the peer step and a submission associated with a workflow
that has no assessments, an overriding staff score will push the workflow into the done state and not crash
when there are no assessments in the "completed" peer step.
"""
mock_get_workflow.return_value = None
mock_get_staff_score.return_value = {
"points_earned": 10,
"points_possible": 10,
"contributing_assessments": 123,
"staff_id": "staff 1",
}
_, submission = self._create_workflow_with_status(
"user 1",
"test/1/1",
"peer-problem",
"peer",
steps=["peer"]
)
workflow_api.update_from_assessments(
submission["uuid"],
{
"peer": {
"must_grade": 5,
"must_be_graded_by": 3
}
},
override_submitter_requirements=True
)
@patch.object(AssessmentWorkflow.objects, 'get')
@ddt.file_data('data/assessments.json')
@raises(workflow_api.AssessmentWorkflowInternalError)
......
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