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
3a3ae8cf
Commit
3a3ae8cf
authored
Jan 30, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a test.
parent
f867e10d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
apps/submissions/tests/test_api.py
+20
-0
No files found.
apps/submissions/tests/test_api.py
View file @
3a3ae8cf
...
...
@@ -17,6 +17,13 @@ STUDENT_ITEM = dict(
item_type
=
"Peer_Submission"
,
)
SECOND_STUDENT_ITEM
=
dict
(
student_id
=
"Bob"
,
course_id
=
"Demo_Course"
,
item_id
=
"item_one"
,
item_type
=
"Peer_Submission"
,
)
ANSWER_ONE
=
u"this is my answer!"
ANSWER_TWO
=
u"this is my other answer!"
...
...
@@ -35,6 +42,19 @@ class TestApi(TestCase):
self
.
_assert_submission
(
submissions
[
1
],
ANSWER_ONE
,
1
,
1
)
self
.
_assert_submission
(
submissions
[
0
],
ANSWER_TWO
,
1
,
2
)
def
test_two_students
(
self
):
create_submission
(
STUDENT_ITEM
,
ANSWER_ONE
)
create_submission
(
SECOND_STUDENT_ITEM
,
ANSWER_TWO
)
submissions
=
get_submissions
(
STUDENT_ITEM
)
self
.
assertEqual
(
1
,
len
(
submissions
))
self
.
_assert_submission
(
submissions
[
0
],
ANSWER_ONE
,
1
,
1
)
submissions
=
get_submissions
(
SECOND_STUDENT_ITEM
)
self
.
assertEqual
(
1
,
len
(
submissions
))
self
.
_assert_submission
(
submissions
[
0
],
ANSWER_TWO
,
2
,
1
)
@file_data
(
'test_valid_student_items.json'
)
def
test_various_student_items
(
self
,
valid_student_item
):
create_submission
(
valid_student_item
,
ANSWER_ONE
)
...
...
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