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
096088cc
Commit
096088cc
authored
Jan 27, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test failures: clear loc_mapper cache
parent
dcc1d201
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
30 deletions
+36
-30
cms/djangoapps/contentstore/tests/test_contentstore.py
+21
-21
common/lib/xmodule/xmodule/modulestore/django.py
+3
-0
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
+10
-7
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+2
-2
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
096088cc
...
@@ -133,7 +133,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -133,7 +133,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# just pick one vertical
# just pick one vertical
descriptor
=
store
.
get_items
(
Location
(
'i4x'
,
'edX'
,
'simple'
,
'vertical'
,
None
,
None
))[
0
]
descriptor
=
store
.
get_items
(
Location
(
'i4x'
,
'edX'
,
'simple'
,
'vertical'
,
None
,
None
))[
0
]
locator
=
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
descriptor
.
location
,
Fals
e
,
True
)
locator
=
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
descriptor
.
location
,
Tru
e
,
True
)
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'unit'
))
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'unit'
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
_test_no_locations
(
self
,
resp
)
_test_no_locations
(
self
,
resp
)
...
@@ -144,12 +144,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -144,12 +144,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
def
test_advanced_components_in_edit_unit
(
self
):
def
test_advanced_components_in_edit_unit
(
self
):
# This could be made better, but for now let's just assert that we see the advanced modules mentioned in the page
# This could be made better, but for now let's just assert that we see the advanced modules mentioned in the page
# response HTML
# response HTML
self
.
check_components_on_page
(
ADVANCED_COMPONENT_TYPES
,
[
'Word cloud'
,
self
.
check_components_on_page
(
'Annotation'
,
ADVANCED_COMPONENT_TYPES
,
'Text Annotation'
,
[
'Word cloud'
,
'Annotation'
,
'Text Annotation'
,
'Video Annotation'
,
'Video Annotation'
,
'Open Response Assessment'
,
'Peer Grading Interface'
],
'Open Response Assessment'
,
)
'Peer Grading Interface'
])
def
test_advanced_components_require_two_clicks
(
self
):
def
test_advanced_components_require_two_clicks
(
self
):
self
.
check_components_on_page
([
'word_cloud'
],
[
'Word cloud'
])
self
.
check_components_on_page
([
'word_cloud'
],
[
'Word cloud'
])
...
@@ -161,7 +160,8 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -161,7 +160,8 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# just pick one vertical
# just pick one vertical
descriptor
=
store
.
get_items
(
Location
(
'i4x'
,
'edX'
,
'simple'
,
'vertical'
,
None
,
None
))[
0
]
descriptor
=
store
.
get_items
(
Location
(
'i4x'
,
'edX'
,
'simple'
,
'vertical'
,
None
,
None
))[
0
]
location
=
descriptor
.
location
.
replace
(
name
=
'.'
+
descriptor
.
location
.
name
)
location
=
descriptor
.
location
.
replace
(
name
=
'.'
+
descriptor
.
location
.
name
)
locator
=
loc_mapper
()
.
translate_location
(
course_items
[
0
]
.
location
.
course_id
,
location
,
False
,
True
)
locator
=
loc_mapper
()
.
translate_location
(
course_items
[
0
]
.
location
.
course_id
,
location
,
add_entry_if_missing
=
True
)
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'unit'
))
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'unit'
))
self
.
assertEqual
(
resp
.
status_code
,
400
)
self
.
assertEqual
(
resp
.
status_code
,
400
)
...
@@ -449,7 +449,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -449,7 +449,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
""" Returns the locator for a given tab. """
""" Returns the locator for a given tab. """
tab_location
=
'i4x://edX/999/static_tab/{0}'
.
format
(
tab
[
'url_slug'
])
tab_location
=
'i4x://edX/999/static_tab/{0}'
.
format
(
tab
[
'url_slug'
])
return
loc_mapper
()
.
translate_location
(
return
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
Location
(
tab_location
),
Fals
e
,
True
course
.
location
.
course_id
,
Location
(
tab_location
),
Tru
e
,
True
)
)
def
_create_static_tabs
(
self
):
def
_create_static_tabs
(
self
):
...
@@ -457,7 +457,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -457,7 +457,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
module_store
=
modulestore
(
'direct'
)
module_store
=
modulestore
(
'direct'
)
CourseFactory
.
create
(
org
=
'edX'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
CourseFactory
.
create
(
org
=
'edX'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
course_location
=
Location
(
'i4x'
,
'edX'
,
'999'
,
'course'
,
'Robot_Super_Course'
,
None
)
course_location
=
Location
(
'i4x'
,
'edX'
,
'999'
,
'course'
,
'Robot_Super_Course'
,
None
)
new_location
=
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
course_location
,
Fals
e
,
True
)
new_location
=
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
course_location
,
Tru
e
,
True
)
ItemFactory
.
create
(
ItemFactory
.
create
(
parent_location
=
course_location
,
parent_location
=
course_location
,
...
@@ -512,7 +512,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -512,7 +512,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# also try a custom response which will trigger the 'is this course in whitelist' logic
# also try a custom response which will trigger the 'is this course in whitelist' logic
locator
=
loc_mapper
()
.
translate_location
(
locator
=
loc_mapper
()
.
translate_location
(
course_items
[
0
]
.
location
.
course_id
,
location
,
Fals
e
,
True
course_items
[
0
]
.
location
.
course_id
,
location
,
Tru
e
,
True
)
)
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'xblock'
))
resp
=
self
.
client
.
get_html
(
locator
.
url_reverse
(
'xblock'
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
...
@@ -534,7 +534,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -534,7 +534,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# make sure the parent points to the child object which is to be deleted
# make sure the parent points to the child object which is to be deleted
self
.
assertTrue
(
sequential
.
location
.
url
()
in
chapter
.
children
)
self
.
assertTrue
(
sequential
.
location
.
url
()
in
chapter
.
children
)
location
=
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
sequential
.
location
,
Fals
e
,
True
)
location
=
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
sequential
.
location
,
Tru
e
,
True
)
self
.
client
.
delete
(
location
.
url_reverse
(
'xblock'
),
{
'recurse'
:
True
,
'all_versions'
:
True
})
self
.
client
.
delete
(
location
.
url_reverse
(
'xblock'
),
{
'recurse'
:
True
,
'all_versions'
:
True
})
found
=
False
found
=
False
...
@@ -685,7 +685,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -685,7 +685,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# go through the website to do the delete, since the soft-delete logic is in the view
# go through the website to do the delete, since the soft-delete logic is in the view
course
=
course_items
[
0
]
course
=
course_items
[
0
]
location
=
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
course
.
location
,
Fals
e
,
True
)
location
=
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
course
.
location
,
Tru
e
,
True
)
url
=
location
.
url_reverse
(
'assets/'
,
'/c4x/edX/toy/asset/sample_static.txt'
)
url
=
location
.
url_reverse
(
'assets/'
,
'/c4x/edX/toy/asset/sample_static.txt'
)
resp
=
self
.
client
.
delete
(
url
)
resp
=
self
.
client
.
delete
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
204
)
self
.
assertEqual
(
resp
.
status_code
,
204
)
...
@@ -1062,7 +1062,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -1062,7 +1062,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
)
)
# Unit test fails in Jenkins without this.
# Unit test fails in Jenkins without this.
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
course_location
,
Fals
e
,
True
)
loc_mapper
()
.
translate_location
(
course_location
.
course_id
,
course_location
,
Tru
e
,
True
)
items
=
module_store
.
get_items
(
stub_location
.
replace
(
category
=
'vertical'
,
name
=
None
))
items
=
module_store
.
get_items
(
stub_location
.
replace
(
category
=
'vertical'
,
name
=
None
))
self
.
_check_verticals
(
items
,
course_location
.
course_id
)
self
.
_check_verticals
(
items
,
course_location
.
course_id
)
...
@@ -1353,7 +1353,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -1353,7 +1353,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# Assert is here to make sure that the course being tested actually has verticals (units) to check.
# Assert is here to make sure that the course being tested actually has verticals (units) to check.
self
.
assertGreater
(
len
(
items
),
0
)
self
.
assertGreater
(
len
(
items
),
0
)
for
descriptor
in
items
:
for
descriptor
in
items
:
unit_locator
=
loc_mapper
()
.
translate_location
(
course_id
,
descriptor
.
location
,
Fals
e
,
True
)
unit_locator
=
loc_mapper
()
.
translate_location
(
course_id
,
descriptor
.
location
,
Tru
e
,
True
)
resp
=
self
.
client
.
get_html
(
unit_locator
.
url_reverse
(
'unit'
))
resp
=
self
.
client
.
get_html
(
unit_locator
.
url_reverse
(
'unit'
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
_test_no_locations
(
self
,
resp
)
_test_no_locations
(
self
,
resp
)
...
@@ -1645,7 +1645,7 @@ class ContentStoreTest(ModuleStoreTestCase):
...
@@ -1645,7 +1645,7 @@ class ContentStoreTest(ModuleStoreTestCase):
import_from_xml
(
modulestore
(
'direct'
),
'common/test/data/'
,
[
'simple'
])
import_from_xml
(
modulestore
(
'direct'
),
'common/test/data/'
,
[
'simple'
])
loc
=
Location
([
'i4x'
,
'edX'
,
'simple'
,
'course'
,
'2012_Fall'
,
None
])
loc
=
Location
([
'i4x'
,
'edX'
,
'simple'
,
'course'
,
'2012_Fall'
,
None
])
new_location
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
loc
,
Fals
e
,
True
)
new_location
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
loc
,
Tru
e
,
True
)
resp
=
self
.
_show_course_overview
(
loc
)
resp
=
self
.
_show_course_overview
(
loc
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
...
@@ -1666,14 +1666,14 @@ class ContentStoreTest(ModuleStoreTestCase):
...
@@ -1666,14 +1666,14 @@ class ContentStoreTest(ModuleStoreTestCase):
# go look at a subsection page
# go look at a subsection page
subsection_location
=
loc
.
replace
(
category
=
'sequential'
,
name
=
'test_sequence'
)
subsection_location
=
loc
.
replace
(
category
=
'sequential'
,
name
=
'test_sequence'
)
subsection_locator
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
subsection_location
,
Fals
e
,
True
)
subsection_locator
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
subsection_location
,
Tru
e
,
True
)
resp
=
self
.
client
.
get_html
(
subsection_locator
.
url_reverse
(
'subsection'
))
resp
=
self
.
client
.
get_html
(
subsection_locator
.
url_reverse
(
'subsection'
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
_test_no_locations
(
self
,
resp
)
_test_no_locations
(
self
,
resp
)
# go look at the Edit page
# go look at the Edit page
unit_location
=
loc
.
replace
(
category
=
'vertical'
,
name
=
'test_vertical'
)
unit_location
=
loc
.
replace
(
category
=
'vertical'
,
name
=
'test_vertical'
)
unit_locator
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
unit_location
,
Fals
e
,
True
)
unit_locator
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
unit_location
,
Tru
e
,
True
)
resp
=
self
.
client
.
get_html
(
unit_locator
.
url_reverse
(
'unit'
))
resp
=
self
.
client
.
get_html
(
unit_locator
.
url_reverse
(
'unit'
))
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
_test_no_locations
(
self
,
resp
)
_test_no_locations
(
self
,
resp
)
...
@@ -1681,7 +1681,7 @@ class ContentStoreTest(ModuleStoreTestCase):
...
@@ -1681,7 +1681,7 @@ class ContentStoreTest(ModuleStoreTestCase):
def
delete_item
(
category
,
name
):
def
delete_item
(
category
,
name
):
""" Helper method for testing the deletion of an xblock item. """
""" Helper method for testing the deletion of an xblock item. """
del_loc
=
loc
.
replace
(
category
=
category
,
name
=
name
)
del_loc
=
loc
.
replace
(
category
=
category
,
name
=
name
)
del_location
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
del_loc
,
Fals
e
,
True
)
del_location
=
loc_mapper
()
.
translate_location
(
loc
.
course_id
,
del_loc
,
Tru
e
,
True
)
resp
=
self
.
client
.
delete
(
del_location
.
url_reverse
(
'xblock'
))
resp
=
self
.
client
.
delete
(
del_location
.
url_reverse
(
'xblock'
))
self
.
assertEqual
(
resp
.
status_code
,
204
)
self
.
assertEqual
(
resp
.
status_code
,
204
)
_test_no_locations
(
self
,
resp
,
status_code
=
204
,
html
=
False
)
_test_no_locations
(
self
,
resp
,
status_code
=
204
,
html
=
False
)
...
@@ -1883,7 +1883,7 @@ class ContentStoreTest(ModuleStoreTestCase):
...
@@ -1883,7 +1883,7 @@ class ContentStoreTest(ModuleStoreTestCase):
"""
"""
Show the course overview page.
Show the course overview page.
"""
"""
new_location
=
loc_mapper
()
.
translate_location
(
location
.
course_id
,
location
,
Fals
e
,
True
)
new_location
=
loc_mapper
()
.
translate_location
(
location
.
course_id
,
location
,
Tru
e
,
True
)
resp
=
self
.
client
.
get_html
(
new_location
.
url_reverse
(
'course/'
,
''
))
resp
=
self
.
client
.
get_html
(
new_location
.
url_reverse
(
'course/'
,
''
))
_test_no_locations
(
self
,
resp
)
_test_no_locations
(
self
,
resp
)
return
resp
return
resp
...
@@ -1998,7 +1998,7 @@ def _course_factory_create_course():
...
@@ -1998,7 +1998,7 @@ def _course_factory_create_course():
Creates a course via the CourseFactory and returns the locator for it.
Creates a course via the CourseFactory and returns the locator for it.
"""
"""
course
=
CourseFactory
.
create
(
org
=
'MITx'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
course
=
CourseFactory
.
create
(
org
=
'MITx'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
return
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
course
.
location
,
Fals
e
,
True
)
return
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
course
.
location
,
Tru
e
,
True
)
def
_get_course_id
(
test_course_data
):
def
_get_course_id
(
test_course_data
):
...
...
common/lib/xmodule/xmodule/modulestore/django.py
View file @
096088cc
...
@@ -152,6 +152,9 @@ def clear_existing_modulestores():
...
@@ -152,6 +152,9 @@ def clear_existing_modulestores():
_MODULESTORES
.
clear
()
_MODULESTORES
.
clear
()
# pylint: disable=W0603
# pylint: disable=W0603
global
_loc_singleton
global
_loc_singleton
cache
=
getattr
(
_loc_singleton
,
"cache"
,
None
)
if
cache
:
cache
.
clear
()
_loc_singleton
=
None
_loc_singleton
=
None
...
...
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
View file @
096088cc
...
@@ -93,7 +93,7 @@ class LocMapperStore(object):
...
@@ -93,7 +93,7 @@ class LocMapperStore(object):
package_id
=
"{0.org}.{0.course}"
.
format
(
course_location
)
package_id
=
"{0.org}.{0.course}"
.
format
(
course_location
)
# very like _interpret_location_id but w/o the _id
# very like _interpret_location_id but w/o the _id
location_id
=
self
.
_construct_location_son
(
location_id
=
self
.
_construct_location_son
(
course_location
.
org
,
course_location
.
course
,
course_location
.
org
,
course_location
.
course
,
course_location
.
name
if
course_location
.
category
==
'course'
else
None
course_location
.
name
if
course_location
.
category
==
'course'
else
None
)
)
...
@@ -219,6 +219,11 @@ class LocMapperStore(object):
...
@@ -219,6 +219,11 @@ class LocMapperStore(object):
return
None
return
None
result
=
None
result
=
None
for
candidate
in
maps
:
for
candidate
in
maps
:
if
get_course
and
'name'
in
candidate
[
'_id'
]:
candidate_id
=
candidate
[
'_id'
]
return
Location
(
'i4x'
,
candidate_id
[
'org'
],
candidate_id
[
'course'
],
'course'
,
candidate_id
[
'name'
]
)
old_course_id
=
self
.
_generate_location_course_id
(
candidate
[
'_id'
])
old_course_id
=
self
.
_generate_location_course_id
(
candidate
[
'_id'
])
for
old_name
,
cat_to_usage
in
candidate
[
'block_map'
]
.
iteritems
():
for
old_name
,
cat_to_usage
in
candidate
[
'block_map'
]
.
iteritems
():
for
category
,
block_id
in
cat_to_usage
.
iteritems
():
for
category
,
block_id
in
cat_to_usage
.
iteritems
():
...
@@ -240,7 +245,7 @@ class LocMapperStore(object):
...
@@ -240,7 +245,7 @@ class LocMapperStore(object):
candidate
[
'course_id'
],
branch
=
candidate
[
'draft_branch'
],
block_id
=
block_id
candidate
[
'course_id'
],
branch
=
candidate
[
'draft_branch'
],
block_id
=
block_id
)
)
self
.
_cache_location_map_entry
(
old_course_id
,
location
,
published_locator
,
draft_locator
)
self
.
_cache_location_map_entry
(
old_course_id
,
location
,
published_locator
,
draft_locator
)
if
get_course
and
category
==
'course'
:
if
get_course
and
category
==
'course'
:
result
=
location
result
=
location
elif
not
get_course
and
block_id
==
locator
.
block_id
:
elif
not
get_course
and
block_id
==
locator
.
block_id
:
...
@@ -261,8 +266,6 @@ class LocMapperStore(object):
...
@@ -261,8 +266,6 @@ class LocMapperStore(object):
return
cached
return
cached
location_id
=
self
.
_interpret_location_course_id
(
old_style_course_id
,
location
)
location_id
=
self
.
_interpret_location_course_id
(
old_style_course_id
,
location
)
if
old_style_course_id
is
None
:
old_style_course_id
=
self
.
_generate_location_course_id
(
location_id
)
maps
=
self
.
location_map
.
find
(
location_id
)
maps
=
self
.
location_map
.
find
(
location_id
)
maps
=
list
(
maps
)
maps
=
list
(
maps
)
...
@@ -320,10 +323,10 @@ class LocMapperStore(object):
...
@@ -320,10 +323,10 @@ class LocMapperStore(object):
return
{
'_id'
:
self
.
_construct_location_son
(
location
.
org
,
location
.
course
,
location
.
name
)}
return
{
'_id'
:
self
.
_construct_location_son
(
location
.
org
,
location
.
course
,
location
.
name
)}
else
:
else
:
return
bson
.
son
.
SON
([(
'_id.org'
,
location
.
org
),
(
'_id.course'
,
location
.
course
)])
return
bson
.
son
.
SON
([(
'_id.org'
,
location
.
org
),
(
'_id.course'
,
location
.
course
)])
def
_generate_location_course_id
(
self
,
entry_id
):
def
_generate_location_course_id
(
self
,
entry_id
):
"""
"""
Generate a Location course_id for the given entry's id
Generate a Location course_id for the given entry's id
.
"""
"""
# strip id envelope if any
# strip id envelope if any
entry_id
=
entry_id
.
get
(
'_id'
,
entry_id
)
entry_id
=
entry_id
.
get
(
'_id'
,
entry_id
)
...
@@ -334,7 +337,7 @@ class LocMapperStore(object):
...
@@ -334,7 +337,7 @@ class LocMapperStore(object):
return
'{0[_id.org]}/{0[_id.course]}'
.
format
(
entry_id
)
return
'{0[_id.org]}/{0[_id.course]}'
.
format
(
entry_id
)
else
:
else
:
return
'{0[org]}/{0[course]}'
.
format
(
entry_id
)
return
'{0[org]}/{0[course]}'
.
format
(
entry_id
)
def
_construct_location_son
(
self
,
org
,
course
,
name
=
None
):
def
_construct_location_son
(
self
,
org
,
course
,
name
=
None
):
"""
"""
Construct the SON needed to repr the location for either a query or an insertion
Construct the SON needed to repr the location for either a query or an insertion
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
096088cc
...
@@ -4,8 +4,8 @@ Modulestore configuration for test cases.
...
@@ -4,8 +4,8 @@ Modulestore configuration for test cases.
from
uuid
import
uuid4
from
uuid
import
uuid4
from
django.test
import
TestCase
from
django.test
import
TestCase
from
xmodule.modulestore.django
import
editable_modulestore
,
\
from
xmodule.modulestore.django
import
(
clear_existing_modulestores
,
loc_mapper
editable_modulestore
,
clear_existing_modulestores
,
loc_mapper
)
from
xmodule.contentstore.django
import
contentstore
from
xmodule.contentstore.django
import
contentstore
...
...
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