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
70c77f48
Commit
70c77f48
authored
Aug 04, 2014
by
Nimisha Asthagiri
Committed by
Don Mitchell
Aug 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup - re-enable Asset checking.
parent
9254cfa9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+8
-0
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+2
-0
common/lib/xmodule/xmodule/tests/__init__.py
+2
-6
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
View file @
70c77f48
...
@@ -33,6 +33,14 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
...
@@ -33,6 +33,14 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
org
,
course
,
run
,
user_id
,
master_branch
=
master_branch
,
**
kwargs
org
,
course
,
run
,
user_id
,
master_branch
=
master_branch
,
**
kwargs
)
)
self
.
_auto_publish_no_children
(
item
.
location
,
item
.
location
.
category
,
user_id
,
**
kwargs
)
self
.
_auto_publish_no_children
(
item
.
location
,
item
.
location
.
category
,
user_id
,
**
kwargs
)
# create any other necessary things as a side effect: ensure they populate the draft branch
# and rely on auto publish to populate the published branch
with
self
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
draft_preferred
,
item
.
id
):
super
(
SplitMongoModuleStore
,
self
)
.
create_course
(
org
,
course
,
run
,
user_id
,
**
kwargs
)
return
item
return
item
def
get_course
(
self
,
course_id
,
depth
=
0
):
def
get_course
(
self
,
course_id
,
depth
=
0
):
...
...
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
70c77f48
...
@@ -303,6 +303,8 @@ def _import_course_module(
...
@@ -303,6 +303,8 @@ def _import_course_module(
log
.
debug
(
'course data_dir={0}'
.
format
(
source_course
.
data_dir
))
log
.
debug
(
'course data_dir={0}'
.
format
(
source_course
.
data_dir
))
with
store
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
draft_preferred
,
dest_course_id
):
course
=
_import_module_and_update_references
(
course
=
_import_module_and_update_references
(
source_course
,
store
,
user_id
,
source_course
,
store
,
user_id
,
course_key
,
course_key
,
...
...
common/lib/xmodule/xmodule/tests/__init__.py
View file @
70c77f48
...
@@ -203,12 +203,12 @@ class CourseComparisonTest(unittest.TestCase):
...
@@ -203,12 +203,12 @@ class CourseComparisonTest(unittest.TestCase):
self
.
_assertCoursesEqual
(
expected_items
,
actual_items
,
actual_course_key
)
self
.
_assertCoursesEqual
(
expected_items
,
actual_items
,
actual_course_key
)
# compare draft
# compare draft
if
expected_store
.
get_modulestore_type
()
==
ModuleStoreEnum
.
Type
.
split
:
if
expected_store
.
get_modulestore_type
(
None
)
==
ModuleStoreEnum
.
Type
.
split
:
revision
=
ModuleStoreEnum
.
RevisionOption
.
draft_only
revision
=
ModuleStoreEnum
.
RevisionOption
.
draft_only
else
:
else
:
revision
=
None
revision
=
None
expected_items
=
expected_store
.
get_items
(
expected_course_key
,
revision
=
revision
)
expected_items
=
expected_store
.
get_items
(
expected_course_key
,
revision
=
revision
)
if
actual_store
.
get_modulestore_type
()
==
ModuleStoreEnum
.
Type
.
split
:
if
actual_store
.
get_modulestore_type
(
None
)
==
ModuleStoreEnum
.
Type
.
split
:
revision
=
ModuleStoreEnum
.
RevisionOption
.
draft_only
revision
=
ModuleStoreEnum
.
RevisionOption
.
draft_only
else
:
else
:
revision
=
None
revision
=
None
...
@@ -276,10 +276,7 @@ class CourseComparisonTest(unittest.TestCase):
...
@@ -276,10 +276,7 @@ class CourseComparisonTest(unittest.TestCase):
# get_children was returning drafts for published parents :-(
# get_children was returning drafts for published parents :-(
if
expect_drafts
or
not
getattr
(
item_child
,
'is_draft'
,
False
)
if
expect_drafts
or
not
getattr
(
item_child
,
'is_draft'
,
False
)
]
]
try
:
self
.
assertEqual
(
expected_children
,
actual_children
)
self
.
assertEqual
(
expected_children
,
actual_children
)
except
:
pass
def
assertAssetEqual
(
self
,
expected_course_key
,
expected_asset
,
actual_course_key
,
actual_asset
):
def
assertAssetEqual
(
self
,
expected_course_key
,
expected_asset
,
actual_course_key
,
actual_asset
):
"""
"""
...
@@ -319,7 +316,6 @@ class CourseComparisonTest(unittest.TestCase):
...
@@ -319,7 +316,6 @@ class CourseComparisonTest(unittest.TestCase):
``actual_course_key`` in ``actual_store`` are identical, allowing for differences related
``actual_course_key`` in ``actual_store`` are identical, allowing for differences related
to their being from different course keys.
to their being from different course keys.
"""
"""
return
# FIXME remove
expected_content
,
expected_count
=
expected_store
.
get_all_content_for_course
(
expected_course_key
)
expected_content
,
expected_count
=
expected_store
.
get_all_content_for_course
(
expected_course_key
)
actual_content
,
actual_count
=
actual_store
.
get_all_content_for_course
(
actual_course_key
)
actual_content
,
actual_count
=
actual_store
.
get_all_content_for_course
(
actual_course_key
)
...
...
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