Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
d633e1d9
Commit
d633e1d9
authored
Sep 28, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new test case
parent
d4a4e290
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
openassessment/workflow/test/test_api.py
+34
-0
No files found.
openassessment/workflow/test/test_api.py
View file @
d633e1d9
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment