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
fb299817
Commit
fb299817
authored
Mar 08, 2016
by
Hassan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11660 from edx/hassan/dump-course-ids-fix
Include CCX courses in dump_course_ids.
parents
5dcdf9a4
48a5b954
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
32 deletions
+4
-32
lms/djangoapps/courseware/management/commands/dump_course_ids.py
+2
-12
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
+2
-20
No files found.
lms/djangoapps/courseware/management/commands/dump_course_ids.py
View file @
fb299817
...
...
@@ -6,6 +6,7 @@ from textwrap import dedent
from
django.core.management.base
import
BaseCommand
,
CommandError
from
xmodule.modulestore.django
import
modulestore
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
class
Command
(
BaseCommand
):
...
...
@@ -24,17 +25,6 @@ class Command(BaseCommand):
)
def
handle
(
self
,
*
args
,
**
options
):
store
=
modulestore
()
name
=
options
[
'modulestore'
]
if
name
!=
'default'
:
# since a store type is given, get that specific store
if
hasattr
(
store
,
'_get_modulestore_by_type'
):
store
=
store
.
_get_modulestore_by_type
(
name
)
if
store
.
get_modulestore_type
()
!=
name
:
raise
CommandError
(
"Modulestore {} not found"
.
format
(
name
))
if
store
is
None
:
raise
CommandError
(
"Unknown modulestore {}"
.
format
(
name
))
output
=
u'
\n
'
.
join
(
unicode
(
course
.
id
)
for
course
in
store
.
get_courses
())
+
'
\n
'
output
=
u'
\n
'
.
join
(
unicode
(
course_overview
.
id
)
for
course_overview
in
CourseOverview
.
get_all_courses
())
+
'
\n
'
return
output
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
View file @
fb299817
...
...
@@ -25,14 +25,6 @@ from xmodule.modulestore.xml_importer import import_course_from_xml
DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
XML_COURSE_DIRS
=
[
'toy'
,
'simple'
]
MAPPINGS
=
{
'edX/toy/2012_Fall'
:
'xml'
,
'edX/simple/2012_Fall'
:
'xml'
,
}
TEST_DATA_MIXED_XML_MODULESTORE
=
mixed_store_config
(
DATA_DIR
,
MAPPINGS
,
include_xml
=
True
,
xml_source_dirs
=
XML_COURSE_DIRS
,
)
@attr
(
'shard_1'
)
...
...
@@ -59,6 +51,7 @@ class CommandsTestBase(ModuleStoreTestCase):
# Add a course with a unicode name.
unique_org
=
factory
.
Sequence
(
lambda
n
:
u'ëḋẌ.
%
d'
%
n
)
CourseFactory
.
create
(
emit_signals
=
True
,
org
=
unique_org
,
course
=
u'śíḿṕĺé'
,
display_name
=
u'2012_Fáĺĺ'
,
...
...
@@ -82,10 +75,8 @@ class CommandsTestBase(ModuleStoreTestCase):
return
out
.
read
()
def
test_dump_course_ids
(
self
):
kwargs
=
{
'modulestore'
:
'default'
}
output
=
self
.
call_command
(
'dump_course_ids'
,
**
kwargs
)
output
=
self
.
call_command
(
'dump_course_ids'
)
dumped_courses
=
output
.
decode
(
'utf-8'
)
.
strip
()
.
split
(
'
\n
'
)
course_ids
=
{
unicode
(
course_id
)
for
course_id
in
self
.
loaded_courses
}
dumped_ids
=
set
(
dumped_courses
)
self
.
assertEqual
(
course_ids
,
dumped_ids
)
...
...
@@ -205,15 +196,6 @@ class CommandsTestBase(ModuleStoreTestCase):
assert_in
(
'edX-simple-2012_Fall/sequential/Lecture_2.xml'
,
names
)
class
CommandsXMLTestCase
(
CommandsTestBase
):
"""
Test case for management commands with the xml modulestore present.
"""
MODULESTORE
=
TEST_DATA_MIXED_XML_MODULESTORE
__test__
=
True
class
CommandsMongoTestCase
(
CommandsTestBase
):
"""
Test case for management commands using the mixed mongo modulestore with old mongo as the default.
...
...
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