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
e10e47d8
Commit
e10e47d8
authored
Jan 29, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for specifying locator to migrate_to_split command
parent
cfdc5b5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+15
-4
No files found.
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
View file @
e10e47d8
...
...
@@ -10,8 +10,8 @@ from contentstore.management.commands.migrate_to_split import Command
from
contentstore.tests.modulestore_config
import
TEST_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.
django
import
loc_mappe
r
from
xmodule.modulestore.django
import
modulestore
,
loc_mapper
from
xmodule.modulestore.
locator
import
CourseLocato
r
# pylint: disable=E1101
...
...
@@ -57,7 +57,7 @@ class TestMigrateToSplit(ModuleStoreTestCase):
self
.
user
=
User
.
objects
.
create_user
(
uname
,
email
,
password
)
self
.
course
=
CourseFactory
()
def
test_
happy_path
_email
(
self
):
def
test_
user
_email
(
self
):
call_command
(
"migrate_to_split"
,
str
(
self
.
course
.
location
),
...
...
@@ -67,7 +67,7 @@ class TestMigrateToSplit(ModuleStoreTestCase):
course_from_split
=
modulestore
(
'split'
)
.
get_course
(
locator
)
self
.
assertIsNotNone
(
course_from_split
)
def
test_
happy_path_
user_id
(
self
):
def
test_user_id
(
self
):
call_command
(
"migrate_to_split"
,
str
(
self
.
course
.
location
),
...
...
@@ -76,3 +76,14 @@ class TestMigrateToSplit(ModuleStoreTestCase):
locator
=
loc_mapper
()
.
translate_location
(
self
.
course
.
id
,
self
.
course
.
location
)
course_from_split
=
modulestore
(
'split'
)
.
get_course
(
locator
)
self
.
assertIsNotNone
(
course_from_split
)
def
test_locator_string
(
self
):
call_command
(
"migrate_to_split"
,
str
(
self
.
course
.
location
),
str
(
self
.
user
.
id
),
"org.dept.name.run"
,
)
locator
=
CourseLocator
(
package_id
=
"org.dept.name.run"
,
branch
=
"published"
)
course_from_split
=
modulestore
(
'split'
)
.
get_course
(
locator
)
self
.
assertIsNotNone
(
course_from_split
)
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