Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-submissions
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-submissions
Commits
2d742a9e
Commit
2d742a9e
authored
Feb 08, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test addition
parent
6b6c99c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
submissions/tests/test_api.py
+21
-0
No files found.
submissions/tests/test_api.py
View file @
2d742a9e
...
@@ -573,6 +573,27 @@ class TestSubmissionsApi(TestCase):
...
@@ -573,6 +573,27 @@ class TestSubmissionsApi(TestCase):
)
)
self
.
assertEqual
(
cached_scores
,
scores
)
self
.
assertEqual
(
cached_scores
,
scores
)
def
test_clear_state
(
self
):
# Create a submission, give it a score, and verify that score exists
submission
=
api
.
create_submission
(
STUDENT_ITEM
,
ANSWER_ONE
)
api
.
set_score
(
submission
[
"uuid"
],
11
,
12
)
score
=
api
.
get_score
(
STUDENT_ITEM
)
self
.
_assert_score
(
score
,
11
,
12
)
self
.
assertEqual
(
score
[
'submission_uuid'
],
submission
[
'uuid'
])
# Reset the score with clear_state=True
# This should set the submission's score to None, and make it unavailable to get_submissions
api
.
reset_score
(
STUDENT_ITEM
[
"student_id"
],
STUDENT_ITEM
[
"course_id"
],
STUDENT_ITEM
[
"item_id"
],
clear_state
=
True
,
)
score
=
api
.
get_score
(
STUDENT_ITEM
)
self
.
assertIsNone
(
score
)
subs
=
api
.
get_submissions
(
STUDENT_ITEM
)
self
.
assertEqual
(
subs
,
[])
@raises
(
api
.
SubmissionRequestError
)
@raises
(
api
.
SubmissionRequestError
)
def
test_error_on_get_top_submissions_too_few
(
self
):
def
test_error_on_get_top_submissions_too_few
(
self
):
student_item
=
copy
.
deepcopy
(
STUDENT_ITEM
)
student_item
=
copy
.
deepcopy
(
STUDENT_ITEM
)
...
...
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