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
272dd2aa
Commit
272dd2aa
authored
Sep 04, 2014
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5071 from edx/split/re-import-issue
LMS-11342 Fix Split reimport issue.
parents
f591f381
b6590228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
cms/djangoapps/contentstore/tests/test_import.py
+12
-3
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+1
-1
No files found.
cms/djangoapps/contentstore/tests/test_import.py
View file @
272dd2aa
...
@@ -8,14 +8,14 @@ Tests for import_from_xml using the mongo modulestore.
...
@@ -8,14 +8,14 @@ Tests for import_from_xml using the mongo modulestore.
from
django.test.client
import
Client
from
django.test.client
import
Client
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
django.conf
import
settings
from
django.conf
import
settings
import
ddt
import
copy
import
copy
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.contentstore.django
import
contentstore
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore.exceptions
import
DuplicateCourseError
from
xmodule.modulestore.tests.factories
import
check_exact_number_of_calls
,
check_number_of_calls
from
xmodule.modulestore.tests.factories
import
check_exact_number_of_calls
,
check_number_of_calls
,
CourseFactory
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
,
AssetLocation
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
,
AssetLocation
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.exceptions
import
NotFoundError
from
xmodule.exceptions
import
NotFoundError
...
@@ -25,6 +25,7 @@ TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE)
...
@@ -25,6 +25,7 @@ TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE)
TEST_DATA_CONTENTSTORE
[
'DOC_STORE_CONFIG'
][
'db'
]
=
'test_xcontent_
%
s'
%
uuid4
()
.
hex
TEST_DATA_CONTENTSTORE
[
'DOC_STORE_CONFIG'
][
'db'
]
=
'test_xcontent_
%
s'
%
uuid4
()
.
hex
@ddt.ddt
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
class
ContentStoreImportTest
(
ModuleStoreTestCase
):
class
ContentStoreImportTest
(
ModuleStoreTestCase
):
"""
"""
...
@@ -37,7 +38,7 @@ class ContentStoreImportTest(ModuleStoreTestCase):
...
@@ -37,7 +38,7 @@ class ContentStoreImportTest(ModuleStoreTestCase):
self
.
client
=
Client
()
self
.
client
=
Client
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
password
)
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
password
)
def
load_test_import_course
(
self
):
def
load_test_import_course
(
self
,
target_course_id
=
None
,
create_new_course_if_not_present
=
False
):
'''
'''
Load the standard course used to test imports
Load the standard course used to test imports
(for do_import_static=False behavior).
(for do_import_static=False behavior).
...
@@ -52,6 +53,8 @@ class ContentStoreImportTest(ModuleStoreTestCase):
...
@@ -52,6 +53,8 @@ class ContentStoreImportTest(ModuleStoreTestCase):
static_content_store
=
content_store
,
static_content_store
=
content_store
,
do_import_static
=
False
,
do_import_static
=
False
,
verbose
=
True
,
verbose
=
True
,
target_course_id
=
target_course_id
,
create_new_course_if_not_present
=
create_new_course_if_not_present
,
)
)
course_id
=
SlashSeparatedCourseKey
(
'edX'
,
'test_import_course'
,
'2012_Fall'
)
course_id
=
SlashSeparatedCourseKey
(
'edX'
,
'test_import_course'
,
'2012_Fall'
)
course
=
module_store
.
get_course
(
course_id
)
course
=
module_store
.
get_course
(
course_id
)
...
@@ -168,6 +171,12 @@ class ContentStoreImportTest(ModuleStoreTestCase):
...
@@ -168,6 +171,12 @@ class ContentStoreImportTest(ModuleStoreTestCase):
with
check_number_of_calls
(
store
,
'_compute_metadata_inheritance_tree'
,
2
):
with
check_number_of_calls
(
store
,
'_compute_metadata_inheritance_tree'
,
2
):
self
.
load_test_import_course
()
self
.
load_test_import_course
()
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_reimport
(
self
,
default_ms_type
):
with
modulestore
()
.
default_store
(
default_ms_type
):
__
,
__
,
course
=
self
.
load_test_import_course
(
create_new_course_if_not_present
=
True
)
self
.
load_test_import_course
(
target_course_id
=
course
.
id
)
def
test_rewrite_reference_list
(
self
):
def
test_rewrite_reference_list
(
self
):
module_store
=
modulestore
()
module_store
=
modulestore
()
target_course_id
=
SlashSeparatedCourseKey
(
'testX'
,
'conditional_copy'
,
'copy_run'
)
target_course_id
=
SlashSeparatedCourseKey
(
'testX'
,
'conditional_copy'
,
'copy_run'
)
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
View file @
272dd2aa
...
@@ -386,7 +386,7 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
...
@@ -386,7 +386,7 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
course_key
=
self
.
_map_revision_to_branch
(
course_key
)
# cast to branch_setting
course_key
=
self
.
_map_revision_to_branch
(
course_key
)
# cast to branch_setting
return
self
.
_update_item_from_fields
(
return
self
.
_update_item_from_fields
(
user_id
,
course_key
,
block_type
,
block_id
,
partitioned_fields
,
None
,
allow_not_found
=
True
,
force
=
True
user_id
,
course_key
,
block_type
,
block_id
,
partitioned_fields
,
None
,
allow_not_found
=
True
,
force
=
True
)
)
or
self
.
get_item
(
new_usage_key
)
def
compute_published_info_internal
(
self
,
xblock
):
def
compute_published_info_internal
(
self
,
xblock
):
"""
"""
...
...
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