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
62643a59
Commit
62643a59
authored
Aug 21, 2014
by
Ben McMorran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken rerun test
parent
d38bd2ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
cms/djangoapps/contentstore/tasks.py
+1
-1
cms/djangoapps/contentstore/tests/test_clone_course.py
+6
-3
No files found.
cms/djangoapps/contentstore/tasks.py
View file @
62643a59
...
...
@@ -23,7 +23,7 @@ def rerun_course(source_course_key_string, destination_course_key_string, user_i
# deserialize the payload
source_course_key
=
CourseKey
.
from_string
(
source_course_key_string
)
destination_course_key
=
CourseKey
.
from_string
(
destination_course_key_string
)
fields
=
deserialize_fields
(
fields
)
fields
=
deserialize_fields
(
fields
)
if
fields
else
None
# use the split modulestore as the store for the rerun course,
# as the Mongo modulestore doesn't support multiple runs of the same course.
...
...
cms/djangoapps/contentstore/tests/test_clone_course.py
View file @
62643a59
"""
Unit tests for cloning a course between the same and different module stores.
"""
import
json
from
opaque_keys.edx.locator
import
CourseLocator
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
,
EdxJSONEncoder
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.tasks
import
rerun_course
from
contentstore.views.access
import
has_course_access
...
...
@@ -58,7 +59,8 @@ class CloneCourseTest(CourseTestCase):
# Mark the action as initiated
fields
=
{
'display_name'
:
'rerun'
}
CourseRerunState
.
objects
.
initiated
(
mongo_course1_id
,
split_course3_id
,
self
.
user
,
fields
[
'display_name'
])
result
=
rerun_course
.
delay
(
unicode
(
mongo_course1_id
),
unicode
(
split_course3_id
),
self
.
user
.
id
,
fields
)
result
=
rerun_course
.
delay
(
unicode
(
mongo_course1_id
),
unicode
(
split_course3_id
),
self
.
user
.
id
,
json
.
dumps
(
fields
,
cls
=
EdxJSONEncoder
))
self
.
assertEqual
(
result
.
get
(),
"succeeded"
)
self
.
assertTrue
(
has_course_access
(
self
.
user
,
split_course3_id
),
"Didn't grant access"
)
rerun_state
=
CourseRerunState
.
objects
.
find_first
(
course_key
=
split_course3_id
)
...
...
@@ -78,7 +80,8 @@ class CloneCourseTest(CourseTestCase):
split_course4_id
=
CourseLocator
(
org
=
"edx3"
,
course
=
"split3"
,
run
=
"rerun_fail"
)
fields
=
{
'display_name'
:
'total failure'
}
CourseRerunState
.
objects
.
initiated
(
split_course3_id
,
split_course4_id
,
self
.
user
,
fields
[
'display_name'
])
result
=
rerun_course
.
delay
(
unicode
(
split_course3_id
),
unicode
(
split_course4_id
),
self
.
user
.
id
,
fields
)
result
=
rerun_course
.
delay
(
unicode
(
split_course3_id
),
unicode
(
split_course4_id
),
self
.
user
.
id
,
json
.
dumps
(
fields
,
cls
=
EdxJSONEncoder
))
self
.
assertIn
(
"exception: "
,
result
.
get
())
self
.
assertIsNone
(
self
.
store
.
get_course
(
split_course4_id
),
"Didn't delete course after error"
)
CourseRerunState
.
objects
.
find_first
(
...
...
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