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
e410a172
Commit
e410a172
authored
Apr 24, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary submission_uuid in self assessment tests
parent
3ae16f20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
apps/openassessment/xblock/self_assessment_mixin.py
+0
-1
apps/openassessment/xblock/test/test_self.py
+9
-16
No files found.
apps/openassessment/xblock/self_assessment_mixin.py
View file @
e410a172
...
...
@@ -92,7 +92,6 @@ class SelfAssessmentMixin(object):
Args:
data (dict): Must have the following keys:
submission_uuid (string): The unique identifier of the submission being assessed.
options_selected (dict): Dictionary mapping criterion names to option values.
Returns:
...
...
apps/openassessment/xblock/test/test_self.py
View file @
e410a172
...
...
@@ -13,13 +13,15 @@ from .base import XBlockHandlerTestCase, scenario
class
TestSelfAssessment
(
XBlockHandlerTestCase
):
"""
Tests for the self-assessment XBlock handler.
"""
maxDiff
=
None
SUBMISSION
=
u'ՇﻉรՇ รપ๒๓ٱรรٱѻก'
ASSESSMENT
=
{
'submission_uuid'
:
None
,
'options_selected'
:
{
u'𝓒𝓸𝓷𝓬𝓲𝓼𝓮'
:
u'ﻉซƈﻉɭɭﻉกՇ'
,
u'Form'
:
u'Fair'
},
}
...
...
@@ -31,9 +33,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
self
.
assertTrue
(
resp
[
'success'
])
# Expect that a self-assessment was created
...
...
@@ -62,9 +62,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
with
mock
.
patch
(
'openassessment.xblock.workflow_mixin.workflow_api'
)
as
mock_api
:
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
# Verify that the workflow is updated when we submit a self-assessment
self
.
assertTrue
(
resp
[
'success'
])
...
...
@@ -77,7 +75,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
def
test_self_assess_workflow_error
(
self
,
xblock
):
# Create a submission for the student
student_item
=
xblock
.
get_student_item_dict
()
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
with
mock
.
patch
(
'openassessment.xblock.workflow_mixin.workflow_api'
)
as
mock_api
:
...
...
@@ -85,9 +83,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
mock_api
.
update_from_assessments
.
side_effect
=
workflow_api
.
AssessmentWorkflowError
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
# Verify that the we get an error response
self
.
assertFalse
(
resp
[
'success'
])
...
...
@@ -106,17 +102,14 @@ class TestSelfAssessment(XBlockHandlerTestCase):
def
test_self_assess_api_error
(
self
,
xblock
):
# Create a submission for the student
student_item
=
xblock
.
get_student_item_dict
()
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
# Simulate an error and expect a failure response
with
mock
.
patch
(
'openassessment.xblock.self_assessment_mixin.self_api'
)
as
mock_api
:
mock_api
.
SelfAssessmentRequestError
=
self_api
.
SelfAssessmentRequestError
mock_api
.
create_assessment
.
side_effect
=
self_api
.
SelfAssessmentRequestError
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
self
.
assertFalse
(
resp
[
'success'
])
...
...
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