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
bd8a7906
Commit
bd8a7906
authored
Aug 12, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify doc/comments on default v explicit mappings
parent
2ad515d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
+3
-2
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
+2
-0
No files found.
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
View file @
bd8a7906
...
@@ -64,8 +64,9 @@ class LocMapperStore(object):
...
@@ -64,8 +64,9 @@ class LocMapperStore(object):
throw an error depending on how mongo is configured.
throw an error depending on how mongo is configured.
:param course_location: a Location preferably whose category is 'course'. Unlike the other
:param course_location: a Location preferably whose category is 'course'. Unlike the other
map methods, this one doesn't take the old-style course_id because it's assumed to be called with
map methods, this one doesn't take the old-style course_id. It should be called with
a course location not a block location.
a course location not a block location; however, if called w/ a non-course Location, it creates
a "default" map for the org/course pair to a new course_id.
:param course_id: the CourseLocator style course_id
:param course_id: the CourseLocator style course_id
:param draft_branch: the branch name to assign for drafts. This is hardcoded because old mongo had
:param draft_branch: the branch name to assign for drafts. This is hardcoded because old mongo had
a fixed notion that there was 2 and only 2 versions for modules: draft and production. The old mongo
a fixed notion that there was 2 and only 2 versions for modules: draft and production. The old mongo
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
View file @
bd8a7906
...
@@ -43,6 +43,8 @@ class TestLocationMapper(unittest.TestCase):
...
@@ -43,6 +43,8 @@ class TestLocationMapper(unittest.TestCase):
self
.
assertEqual
(
entry
[
'prod_branch'
],
'published'
)
self
.
assertEqual
(
entry
[
'prod_branch'
],
'published'
)
self
.
assertEqual
(
entry
[
'block_map'
],
{})
self
.
assertEqual
(
entry
[
'block_map'
],
{})
# ensure create_entry does the right thing when not given a course (creates org/course
# rather than org/course/run course_id)
loc_mapper
()
.
create_map_entry
(
Location
(
'i4x'
,
org
,
course
,
'vertical'
,
'baz_vert'
))
loc_mapper
()
.
create_map_entry
(
Location
(
'i4x'
,
org
,
course
,
'vertical'
,
'baz_vert'
))
entry
=
loc_mapper
()
.
location_map
.
find_one
({
entry
=
loc_mapper
()
.
location_map
.
find_one
({
'_id'
:
{
'org'
:
org
,
'course'
:
course
}
'_id'
:
{
'org'
:
org
,
'course'
:
course
}
...
...
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