Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
b6590228
Commit
b6590228
authored
10 years ago
by
Nimisha Asthagiri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-11342 Fix Split reimport issue.
parent
2cba87d0
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/tests/test_import.py
+12
-3
12 additions, 3 deletions
cms/djangoapps/contentstore/tests/test_import.py
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+1
-1
1 addition, 1 deletion
...ib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
with
13 additions
and
4 deletions
cms/djangoapps/contentstore/tests/test_import.py
+
12
−
3
View file @
b6590228
...
...
@@ -8,14 +8,14 @@ Tests for import_from_xml using the mongo modulestore.
from
django.test.client
import
Client
from
django.test.utils
import
override_settings
from
django.conf
import
settings
import
ddt
import
copy
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
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
,
CourseFactory
from
xmodule.modulestore.tests.factories
import
check_exact_number_of_calls
,
check_number_of_calls
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
,
AssetLocation
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.exceptions
import
NotFoundError
...
...
@@ -25,6 +25,7 @@ TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE)
TEST_DATA_CONTENTSTORE
[
'
DOC_STORE_CONFIG
'
][
'
db
'
]
=
'
test_xcontent_%s
'
%
uuid4
().
hex
@ddt.ddt
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
class
ContentStoreImportTest
(
ModuleStoreTestCase
):
"""
...
...
@@ -37,7 +38,7 @@ class ContentStoreImportTest(ModuleStoreTestCase):
self
.
client
=
Client
()
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
(for do_import_static=False behavior).
...
...
@@ -52,6 +53,8 @@ class ContentStoreImportTest(ModuleStoreTestCase):
static_content_store
=
content_store
,
do_import_static
=
False
,
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
=
module_store
.
get_course
(
course_id
)
...
...
@@ -168,6 +171,12 @@ class ContentStoreImportTest(ModuleStoreTestCase):
with
check_number_of_calls
(
store
,
'
_compute_metadata_inheritance_tree
'
,
2
):
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
):
module_store
=
modulestore
()
target_course_id
=
SlashSeparatedCourseKey
(
'
testX
'
,
'
conditional_copy
'
,
'
copy_run
'
)
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+
1
−
1
View file @
b6590228
...
...
@@ -386,7 +386,7 @@ class DraftVersioningModuleStore(ModuleStoreDraftAndPublished, SplitMongoModuleS
course_key
=
self
.
_map_revision_to_branch
(
course_key
)
# cast to branch_setting
return
self
.
_update_item_from_fields
(
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
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment