Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
c2964988
Commit
c2964988
authored
Jan 24, 2014
by
Usman Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2291 from edx/usman/fix-openended-post-command-tests
Fixed flaky test for instructor command openended_post.
parents
598fb1a1
e0ecf011
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
lms/djangoapps/instructor/management/tests/test_openended_commands.py
+10
-11
No files found.
lms/djangoapps/instructor/management/tests/test_openended_commands.py
View file @
c2964988
...
@@ -87,20 +87,19 @@ class OpenEndedPostTest(ModuleStoreTestCase):
...
@@ -87,20 +87,19 @@ class OpenEndedPostTest(ModuleStoreTestCase):
module
=
get_module_for_student
(
self
.
student_on_accessing
,
course
,
self
.
problem_location
)
module
=
get_module_for_student
(
self
.
student_on_accessing
,
course
,
self
.
problem_location
)
task
=
module
.
child_module
.
get_task_number
(
self
.
open_ended_task_number
)
task
=
module
.
child_module
.
get_task_number
(
self
.
open_ended_task_number
)
qtime
=
datetime
.
strftime
(
datetime
.
now
(
UTC
),
xqueue_interface
.
dateformat
)
student_response
=
"Here is an answer."
student_info
=
{
'anonymous_student_id'
:
anonymous_id_for_user
(
self
.
student_on_accessing
,
''
),
student_anonymous_id
=
anonymous_id_for_user
(
self
.
student_on_accessing
,
''
)
'submission_time'
:
qtime
}
submission_time
=
datetime
.
strftime
(
datetime
.
now
(
UTC
),
xqueue_interface
.
dateformat
)
contents
=
task
.
payload
.
copy
()
contents
.
update
({
'max_score'
:
2
,
'student_info'
:
json
.
dumps
(
student_info
),
'student_response'
:
"Here is an answer."
,
})
result
=
post_submission_for_student
(
self
.
student_on_accessing
,
course
,
self
.
problem_location
,
self
.
open_ended_task_number
,
dry_run
=
False
)
result
=
post_submission_for_student
(
self
.
student_on_accessing
,
course
,
self
.
problem_location
,
self
.
open_ended_task_number
,
dry_run
=
False
)
self
.
assertTrue
(
result
)
self
.
assertTrue
(
result
)
mock_send_to_queue
.
assert_called_with
(
body
=
json
.
dumps
(
contents
),
header
=
ANY
)
mock_send_to_queue_body_arg
=
json
.
loads
(
mock_send_to_queue
.
call_args
[
1
][
'body'
])
self
.
assertEqual
(
mock_send_to_queue_body_arg
[
'max_score'
],
2
)
self
.
assertEqual
(
mock_send_to_queue_body_arg
[
'student_response'
],
student_response
)
body_arg_student_info
=
json
.
loads
(
mock_send_to_queue_body_arg
[
'student_info'
])
self
.
assertEqual
(
body_arg_student_info
[
'anonymous_student_id'
],
student_anonymous_id
)
self
.
assertGreaterEqual
(
body_arg_student_info
[
'submission_time'
],
submission_time
)
def
test_post_submission_for_student_on_post_assessment
(
self
):
def
test_post_submission_for_student_on_post_assessment
(
self
):
course
=
get_course_with_access
(
self
.
student_on_post_assessment
,
self
.
course_id
,
'load'
)
course
=
get_course_with_access
(
self
.
student_on_post_assessment
,
self
.
course_id
,
'load'
)
...
...
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