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
ed7b92cf
Commit
ed7b92cf
authored
Jan 30, 2015
by
zubair-arbi
Committed by
David Baumgold
Feb 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't add xblock with 'detached' tag as direct child of course for split in 'create_child' method
PLAT-420
parent
afca5d06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+4
-0
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+21
-0
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
ed7b92cf
...
...
@@ -1513,6 +1513,10 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
user_id
,
parent_usage_key
.
course_key
,
block_type
,
block_id
=
block_id
,
fields
=
fields
,
**
kwargs
)
# skip attach to parent if xblock has 'detached' tag
if
'detached'
in
xblock
.
_class_tags
:
# pylint: disable=protected-access
return
xblock
# don't version the structure as create_item handled that already.
new_structure
=
self
.
_lookup_course
(
xblock
.
location
.
course_key
)
.
structure
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
ed7b92cf
...
...
@@ -840,6 +840,27 @@ class TestMixedModuleStore(CourseComparisonTest):
published_courses
=
self
.
store
.
get_courses
(
remove_branch
=
True
)
self
.
assertEquals
([
c
.
id
for
c
in
draft_courses
],
[
c
.
id
for
c
in
published_courses
])
@ddt.data
(
'draft'
,
'split'
)
def
test_create_child_detached_tabs
(
self
,
default_ms
):
"""
test 'create_child' method with a detached category ('static_tab')
to check that new static tab is not a direct child of the course
"""
self
.
initdb
(
default_ms
)
mongo_course
=
self
.
store
.
get_course
(
self
.
course_locations
[
self
.
MONGO_COURSEID
]
.
course_key
)
self
.
assertEqual
(
len
(
mongo_course
.
children
),
1
)
# create a static tab of the course
self
.
store
.
create_child
(
self
.
user_id
,
self
.
course
.
location
,
'static_tab'
)
# now check that the course has same number of children
mongo_course
=
self
.
store
.
get_course
(
self
.
course_locations
[
self
.
MONGO_COURSEID
]
.
course_key
)
self
.
assertEqual
(
len
(
mongo_course
.
children
),
1
)
def
test_xml_get_courses
(
self
):
"""
Test that the xml modulestore only loaded the courses from the maps.
...
...
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