Commit a3a23a99 by Eric Fischer Committed by Andy Armstrong

Adding "no start_workflow()" test

Fairly simple test, should help to provide some extra peace of mind.
parent 75d8a39e
......@@ -278,6 +278,30 @@ class TestAssessmentWorkflowApi(CacheResetTest):
workflow = workflow_api.create_workflow(submission["uuid"], data["steps"], ON_INIT_PARAMS)
workflow_api.get_workflow_for_submission(workflow["uuid"], {})
def test_preexisting_workflow(self):
"""
Verifies that even if a workflow does not go through start_workflow, it won't blow up.
update_from_assessments() will go through _get_steps(), and add a staff step to the workflow
even if it was created without one initially.
"""
submission = sub_api.create_submission({
"student_id": "test student",
"course_id": "test course",
"item_id": "test item",
"item_type": "openassessment",
}, "test answer")
# Create the model object directly, bypassing start_workflow()
workflow = AssessmentWorkflow.objects.create(
submission_uuid=submission["uuid"],
status=AssessmentWorkflow.STATUS.waiting,
course_id="test course",
item_id="test item"
)
# This call will throw exceptions if the workflow is in an invalid state
workflow_api.update_from_assessments(submission["uuid"], {})
def test_get_status_counts(self):
# Initially, the counts should all be zero
counts = workflow_api.get_status_counts(
......
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