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
486aa58f
Commit
486aa58f
authored
Aug 06, 2015
by
Syed Hasan raza
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8889 from edx/shr/bug/TNL-2686-library-export-then-import-error
Test library failed to export after import
parents
4c9b6637
4c1c4619
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
11 deletions
+46
-11
cms/djangoapps/contentstore/tests/test_contentstore.py
+2
-2
cms/djangoapps/contentstore/views/course.py
+1
-1
cms/djangoapps/contentstore/views/tests/test_import_export.py
+35
-0
cms/djangoapps/contentstore/views/tests/test_item.py
+1
-1
common/lib/xmodule/xmodule/course_module.py
+1
-1
lms/djangoapps/django_comment_client/utils.py
+1
-1
lms/djangoapps/mobile_api/users/tests.py
+2
-2
openedx/core/djangoapps/content/course_overviews/tests.py
+2
-2
requirements/edx/github.txt
+1
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
486aa58f
...
...
@@ -1769,8 +1769,8 @@ class RerunCourseTest(ContentStoreTestCase):
source_course
=
CourseFactory
.
create
(
advertised_start
=
"01-12-2015"
)
destination_course_key
=
self
.
post_rerun_request
(
source_course
.
id
)
destination_course
=
self
.
store
.
get_course
(
destination_course_key
)
self
.
assertEqual
(
None
,
destination_course
.
advertised_start
)
# Advertised_start is String field so it will return empty string if its not set
self
.
assertEqual
(
''
,
destination_course
.
advertised_start
)
def
test_rerun_of_rerun
(
self
):
source_course
=
CourseFactory
.
create
()
...
...
cms/djangoapps/contentstore/views/course.py
View file @
486aa58f
...
...
@@ -787,7 +787,7 @@ def _rerun_course(request, org, number, run, fields):
CourseRerunState
.
objects
.
initiated
(
source_course_key
,
destination_course_key
,
request
.
user
,
fields
[
'display_name'
])
# Clear the fields that must be reset for the rerun
fields
[
'advertised_start'
]
=
None
fields
[
'advertised_start'
]
=
''
# Rerun the course as a new celery task
json_fields
=
json
.
dumps
(
fields
,
cls
=
EdxJSONEncoder
)
...
...
cms/djangoapps/contentstore/views/tests/test_import_export.py
View file @
486aa58f
...
...
@@ -451,6 +451,41 @@ class ExportTestCase(CourseTestCase):
finally
:
shutil
.
rmtree
(
root_dir
/
name
)
def
test_library_import_then_export
(
self
):
"""
Verify that a library exports successfully after being imported.
"""
library
=
LibraryFactory
.
create
(
modulestore
=
self
.
store
)
lib_key
=
library
.
location
.
library_key
name
=
library
.
url_name
# import the library
extract_dir
=
path
(
tempfile
.
mkdtemp
(
dir
=
settings
.
DATA_DIR
))
extract_dir_relative
=
path
.
relpath
(
extract_dir
,
settings
.
DATA_DIR
)
try
:
with
tarfile
.
open
(
path
(
TEST_DATA_DIR
)
/
'imports'
/
'library.HhJfPD.tar.gz'
)
as
tar
:
safetar_extractall
(
tar
,
extract_dir
)
library_items
=
import_library_from_xml
(
self
.
store
,
self
.
user
.
id
,
settings
.
GITHUB_REPO_ROOT
,
[
extract_dir_relative
/
'library'
],
load_error_modules
=
False
,
static_content_store
=
contentstore
(),
target_id
=
lib_key
)
# verify library import correctly
self
.
assertEqual
(
lib_key
,
library_items
[
0
]
.
location
.
library_key
)
library
=
self
.
store
.
get_library
(
lib_key
)
self
.
assertEqual
(
len
(
library
.
children
),
3
)
# export library again
export_library_to_xml
(
self
.
store
,
contentstore
(),
lib_key
,
extract_dir
,
name
)
finally
:
shutil
.
rmtree
(
extract_dir
)
def
test_export_success_with_custom_tag
(
self
):
"""
Verify that course export with customtag
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
486aa58f
...
...
@@ -625,7 +625,7 @@ class TestEditItem(TestEditItemSetup):
data
=
{
'nullout'
:
[
'markdown'
]}
)
problem
=
self
.
get_item_from_modulestore
(
self
.
problem_usage_key
,
verify_is_draft
=
True
)
self
.
assert
IsNone
(
problem
.
markdown
)
self
.
assert
Equal
(
problem
.
markdown
,
''
)
def
test_date_fields
(
self
):
"""
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
486aa58f
...
...
@@ -948,7 +948,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor, LicenseMixin):
super
(
CourseDescriptor
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
if
self
.
wiki_slug
is
None
:
if
not
self
.
wiki_slug
:
self
.
wiki_slug
=
self
.
location
.
course
if
self
.
due_date_display_format
is
None
and
self
.
show_timezone
is
False
:
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
486aa58f
...
...
@@ -87,7 +87,7 @@ def has_forum_access(uname, course_id, rolename):
def
has_required_keys
(
module
):
"""Returns True iff module has the proper attributes for generating metadata with get_discussion_id_map_entry()"""
for
key
in
(
'discussion_id'
,
'discussion_category'
,
'discussion_target'
):
if
getattr
(
module
,
key
,
None
)
is
None
:
if
not
getattr
(
module
,
key
,
None
)
:
log
.
debug
(
"Required key '
%
s' not in discussion
%
s, leaving out of category map"
,
key
,
module
.
location
)
return
False
return
True
...
...
lms/djangoapps/mobile_api/users/tests.py
View file @
486aa58f
...
...
@@ -146,9 +146,9 @@ class TestUserEnrollmentApi(MobileAPITestCase, MobileAuthUserTestMixin):
@ddt.data
(
(
NEXT_WEEK
,
ADVERTISED_START
,
ADVERTISED_START
,
"string"
),
(
NEXT_WEEK
,
None
,
defaultfilters
.
date
(
NEXT_WEEK
,
"DATE_FORMAT"
),
"timestamp
"
),
(
NEXT_WEEK
,
None
,
''
,
"string
"
),
(
DEFAULT_START_DATE
,
ADVERTISED_START
,
ADVERTISED_START
,
"string"
),
(
DEFAULT_START_DATE
,
None
,
None
,
"empty
"
)
(
DEFAULT_START_DATE
,
None
,
''
,
"string
"
)
)
@ddt.unpack
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
...
...
openedx/core/djangoapps/content/course_overviews/tests.py
View file @
486aa58f
...
...
@@ -191,7 +191,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
"display_name"
:
""
,
# Empty display name
"start"
:
LAST_MONTH
,
# Course already ended
"end"
:
LAST_WEEK
,
"advertised_start"
:
None
,
# No advertised start
"advertised_start"
:
''
,
# No advertised start
"pre_requisite_courses"
:
[],
# No pre-requisites
"static_asset_path"
:
""
,
# Empty asset path
"certificates_show_before_end"
:
False
,
...
...
@@ -200,7 +200,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
# # Don't set display name
"start"
:
DEFAULT_START_DATE
,
# Default start and end dates
"end"
:
None
,
"advertised_start"
:
None
,
# No advertised start
"advertised_start"
:
''
,
# No advertised start
"pre_requisite_courses"
:
[],
# No pre-requisites
"static_asset_path"
:
None
,
# No asset path
"certificates_show_before_end"
:
False
,
...
...
requirements/edx/github.txt
View file @
486aa58f
...
...
@@ -34,7 +34,7 @@ git+https://github.com/hmarr/django-debug-toolbar-mongo.git@b0686a76f1ce3532088c
git+https://github.com/edx/rfc6266.git@v0.0.5-edx#egg=rfc6266==0.0.5-edx
# Our libraries:
-e git+https://github.com/edx/XBlock.git@
d1ff8cf31a9b94916ce06ba06d4176bd72e15768
#egg=XBlock
-e git+https://github.com/edx/XBlock.git@
0d3d43bd1ef0f882ef70d19d4f652d35dd37eb01
#egg=XBlock
-e git+https://github.com/edx/codejail.git@6b17c33a89bef0ac510926b1d7fea2748b73aadd#egg=codejail
-e git+https://github.com/edx/js-test-tool.git@v0.1.6#egg=js_test_tool
-e git+https://github.com/edx/event-tracking.git@0.2.0#egg=event-tracking
...
...
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