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
d3bb7225
Commit
d3bb7225
authored
Apr 14, 2015
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7683 from edx/release
Release
parents
a3aecb20
52488cae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
59 deletions
+0
-59
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
+0
-4
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+0
-55
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split_draft.py
View file @
d3bb7225
...
...
@@ -500,10 +500,6 @@ class DraftVersioningModuleStore(SplitMongoModuleStore, ModuleStoreDraftAndPubli
draft_course
=
course_key
.
for_branch
(
ModuleStoreEnum
.
BranchName
.
draft
)
with
self
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
draft_preferred
,
draft_course
):
draft_block
=
self
.
import_xblock
(
user_id
,
draft_course
,
block_type
,
block_id
,
fields
,
runtime
)
# if block was published once and now it is in draft state then return draft version
# as current state of block is draft state
if
self
.
has_published_version
(
draft_block
)
and
block_type
not
in
DIRECT_ONLY_CATEGORIES
:
return
draft_block
return
self
.
publish
(
draft_block
.
location
.
version_agnostic
(),
user_id
,
blacklist
=
EXCLUDE_ALL
,
**
kwargs
)
# do the import
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
d3bb7225
...
...
@@ -10,8 +10,6 @@ import itertools
import
mimetypes
from
unittest
import
skip
from
uuid
import
uuid4
from
shutil
import
rmtree
from
tempfile
import
mkdtemp
# Mixed modulestore depends on django, so we'll manually configure some django settings
# before importing the module
...
...
@@ -29,7 +27,6 @@ from xmodule.modulestore.tests.test_cross_modulestore_import_export import Mongo
from
xmodule.contentstore.content
import
StaticContent
from
opaque_keys.edx.keys
import
CourseKey
from
xmodule.modulestore.xml_importer
import
import_course_from_xml
from
xmodule.modulestore.xml_exporter
import
export_course_to_xml
from
xmodule.modulestore.django
import
SignalHandler
if
not
settings
.
configured
:
...
...
@@ -156,8 +153,6 @@ class TestMixedModuleStore(CourseComparisonTest):
self
.
course_locations
=
{}
self
.
user_id
=
ModuleStoreEnum
.
UserID
.
test
self
.
export_dir
=
mkdtemp
()
self
.
addCleanup
(
rmtree
,
self
.
export_dir
,
ignore_errors
=
True
)
# pylint: disable=invalid-name
def
_create_course
(
self
,
course_key
):
...
...
@@ -511,56 +506,6 @@ class TestMixedModuleStore(CourseComparisonTest):
component
=
self
.
store
.
publish
(
component
.
location
,
self
.
user_id
)
self
.
assertFalse
(
self
.
store
.
has_changes
(
component
))
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_has_changes_before_export_and_after_import
(
self
,
default_ms
):
"""
Tests that an unpublished unit remains with no changes across export and re-import.
"""
with
MongoContentstoreBuilder
()
.
build
()
as
contentstore
:
# initialize the mixed modulestore
self
.
_initialize_mixed
(
contentstore
=
contentstore
,
mappings
=
{})
with
self
.
store
.
default_store
(
default_ms
):
source_course_key
=
self
.
store
.
make_course_key
(
"org.source"
,
"course.source"
,
"run.source"
)
self
.
_create_course
(
source_course_key
)
# Create a dummy component to test against
xblock
=
self
.
store
.
create_item
(
self
.
user_id
,
self
.
course
.
id
,
'vertical'
,
block_id
=
'test_vertical'
)
# Not yet published, so changes are present
self
.
assertTrue
(
self
.
store
.
has_changes
(
xblock
))
export_course_to_xml
(
self
.
store
,
contentstore
,
source_course_key
,
self
.
export_dir
,
'exported_source_course'
,
)
import_course_from_xml
(
self
.
store
,
'test_user'
,
self
.
export_dir
,
source_dirs
=
[
'exported_source_course'
],
static_content_store
=
contentstore
,
target_id
=
source_course_key
,
create_if_not_present
=
True
,
raise_on_failure
=
True
,
)
# Get the xblock from the imported course.
component
=
self
.
store
.
get_item
(
xblock
.
location
)
# Verify that it still is a draft, i.e. has changes.
self
.
assertTrue
(
self
.
store
.
has_changes
(
component
))
def
_has_changes
(
self
,
location
):
"""
Helper function that loads the item before calling has_changes
...
...
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