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
f9a85c44
Commit
f9a85c44
authored
Dec 21, 2015
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove XML modulestore code - discovery work
parent
7864ec1c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
111 deletions
+3
-111
cms/djangoapps/contentstore/tests/test_courseware_index.py
+0
-9
common/lib/xmodule/xmodule/modulestore/mixed.py
+1
-10
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+0
-25
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+0
-9
lms/djangoapps/courseware/tests/test_module_render.py
+2
-31
lms/djangoapps/courseware/tests/tests.py
+0
-19
lms/envs/common.py
+0
-8
No files found.
cms/djangoapps/contentstore/tests/test_courseware_index.py
View file @
f9a85c44
...
...
@@ -124,15 +124,6 @@ class MixedWithOptionsTestCase(MixedSplitTestCase):
'DOC_STORE_CONFIG'
:
DOC_STORE_CONFIG
,
'OPTIONS'
:
modulestore_options
},
{
'NAME'
:
'xml'
,
'ENGINE'
:
'xmodule.modulestore.xml.XMLModuleStore'
,
'OPTIONS'
:
{
'data_dir'
:
DATA_DIR
,
'default_class'
:
'xmodule.hidden_module.HiddenDescriptor'
,
'xblock_mixins'
:
modulestore_options
[
'xblock_mixins'
],
}
},
],
'xblock_mixins'
:
modulestore_options
[
'xblock_mixins'
],
}
...
...
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
f9a85c44
"""
MixedModuleStore allows for aggregation between multiple modulestores.
In this way, courses can be served up
both - say - XMLModuleStore or MongoModuleStore
In this way, courses can be served up
via either SplitMongoModuleStore or MongoModuleStore.
"""
...
...
@@ -169,15 +169,6 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
for
store_settings
in
stores
:
key
=
store_settings
[
'NAME'
]
is_xml
=
'XMLModuleStore'
in
store_settings
[
'ENGINE'
]
if
is_xml
:
# restrict xml to only load courses in mapping
store_settings
[
'OPTIONS'
][
'course_ids'
]
=
[
course_key
.
to_deprecated_string
()
for
course_key
,
store_key
in
self
.
mappings
.
iteritems
()
if
store_key
==
key
]
store
=
create_modulestore_instance
(
store_settings
[
'ENGINE'
],
self
.
contentstore
,
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
f9a85c44
...
...
@@ -140,28 +140,6 @@ def split_mongo_store_config(data_dir):
return
store
def
xml_store_config
(
data_dir
,
source_dirs
=
None
):
"""
Defines default module store using XMLModuleStore.
Note: you should pass in a list of source_dirs that you care about,
otherwise all courses in the data_dir will be processed.
"""
store
=
{
'default'
:
{
'NAME'
:
'xml'
,
'ENGINE'
:
'xmodule.modulestore.xml.XMLModuleStore'
,
'OPTIONS'
:
{
'data_dir'
:
data_dir
,
'default_class'
:
'xmodule.hidden_module.HiddenDescriptor'
,
'source_dirs'
:
source_dirs
,
}
}
}
return
store
@patch
(
'xmodule.modulestore.django.create_modulestore_instance'
,
autospec
=
True
)
def
drop_mongo_collections
(
mock_create
):
"""
...
...
@@ -180,9 +158,6 @@ def drop_mongo_collections(mock_create):
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
# This is an XML only modulestore with only the toy course loaded
TEST_DATA_XML_MODULESTORE
=
xml_store_config
(
TEST_DATA_DIR
,
source_dirs
=
[
'toy'
])
# This modulestore will provide both a mixed mongo editable modulestore, and
# an XML store with just the toy course loaded.
TEST_DATA_MIXED_TOY_MODULESTORE
=
mixed_store_config
(
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
f9a85c44
...
...
@@ -110,15 +110,6 @@ class CommonMixedModuleStoreSetup(CourseComparisonTest):
'DOC_STORE_CONFIG'
:
DOC_STORE_CONFIG
,
'OPTIONS'
:
modulestore_options
},
{
'NAME'
:
ModuleStoreEnum
.
Type
.
xml
,
'ENGINE'
:
'xmodule.modulestore.xml.XMLModuleStore'
,
'OPTIONS'
:
{
'data_dir'
:
DATA_DIR
,
'default_class'
:
'xmodule.hidden_module.HiddenDescriptor'
,
'xblock_mixins'
:
modulestore_options
[
'xblock_mixins'
],
}
},
],
'xblock_mixins'
:
modulestore_options
[
'xblock_mixins'
],
}
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
f9a85c44
...
...
@@ -44,8 +44,8 @@ from openedx.core.lib.gating import api as gating_api
from
student.models
import
anonymous_id_for_user
from
xmodule.modulestore.tests.django_utils
import
(
TEST_DATA_MIXED_TOY_MODULESTORE
,
TEST_DATA_XML_MODULESTORE
,
SharedModuleStoreTestCase
)
SharedModuleStoreTestCase
)
from
xmodule.lti_module
import
LTIDescriptor
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -1369,17 +1369,6 @@ class ViewInStudioTest(ModuleStoreTestCase):
# pylint: disable=attribute-defined-outside-init
self
.
child_module
=
self
.
_get_module
(
course
.
id
,
child_descriptor
,
child_descriptor
.
location
)
def
setup_xml_course
(
self
):
"""
Define the XML backed course to use.
Toy courses are already loaded in XML and mixed modulestores.
"""
course_key
=
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
)
location
=
course_key
.
make_usage_key
(
'chapter'
,
'Overview'
)
descriptor
=
modulestore
()
.
get_item
(
location
)
self
.
module
=
self
.
_get_module
(
course_key
,
descriptor
,
location
)
@attr
(
'shard_1'
)
class
MongoViewInStudioTest
(
ViewInStudioTest
):
...
...
@@ -1428,24 +1417,6 @@ class MixedViewInStudioTest(ViewInStudioTest):
result_fragment
=
self
.
module
.
render
(
STUDENT_VIEW
,
context
=
self
.
default_context
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
def
test_view_in_studio_link_xml_backed
(
self
):
"""Course in XML only modulestore should not see 'View in Studio' links."""
self
.
setup_xml_course
()
result_fragment
=
self
.
module
.
render
(
STUDENT_VIEW
,
context
=
self
.
default_context
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
@attr
(
'shard_1'
)
class
XmlViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in an xml backed course."""
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
def
test_view_in_studio_link_xml_backed
(
self
):
"""Course in XML only modulestore should not see 'View in Studio' links."""
self
.
setup_xml_course
()
result_fragment
=
self
.
module
.
render
(
STUDENT_VIEW
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
@XBlock.tag
(
"detached"
)
class
DetachedXBlock
(
XBlock
):
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
f9a85c44
...
...
@@ -10,7 +10,6 @@ from nose.plugins.attrib import attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_XML_MODULESTORE
as
XML_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_TOY_MODULESTORE
as
TOY_MODULESTORE
from
lms.djangoapps.lms_xblock.field_data
import
LmsFieldData
from
xmodule.error_module
import
ErrorDescriptor
...
...
@@ -123,24 +122,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
@attr
(
'shard_1'
)
class
TestXmlCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
"""
Check that all pages in test courses load properly from XML.
"""
MODULESTORE
=
XML_MODULESTORE
def
setUp
(
self
):
super
(
TestXmlCoursesLoad
,
self
)
.
setUp
()
self
.
setup_user
()
def
test_toy_course_loads
(
self
):
# Load one of the XML based courses
# Our test mapping rules allow the MixedModuleStore
# to load this course from XML, not Mongo.
self
.
check_all_pages_load
(
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
))
@attr
(
'shard_1'
)
class
TestMongoCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
"""
Check that all pages in test courses load properly from Mongo.
...
...
lms/envs/common.py
View file @
f9a85c44
...
...
@@ -735,14 +735,6 @@ MODULESTORE = {
'fs_root'
:
DATA_DIR
,
'render_template'
:
'edxmako.shortcuts.render_to_string'
,
}
},
{
'NAME'
:
'xml'
,
'ENGINE'
:
'xmodule.modulestore.xml.XMLModuleStore'
,
'OPTIONS'
:
{
'data_dir'
:
DATA_DIR
,
'default_class'
:
'xmodule.hidden_module.HiddenDescriptor'
,
}
}
]
}
...
...
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