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
f264e5dd
Commit
f264e5dd
authored
5 years ago
by
Ahtisham Shahid
Browse files
Options
Downloads
Patches
Plain Diff
fixed \n escape issue in import
updated test updated test
parent
ccbd3532
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/views/tests/test_import_export.py
+4
-4
4 additions, 4 deletions
...djangoapps/contentstore/views/tests/test_import_export.py
common/lib/xmodule/xmodule/raw_module.py
+1
-1
1 addition, 1 deletion
common/lib/xmodule/xmodule/raw_module.py
with
5 additions
and
5 deletions
cms/djangoapps/contentstore/views/tests/test_import_export.py
+
4
−
4
View file @
f264e5dd
...
...
@@ -1059,7 +1059,8 @@ class TestCourseExportImportProblem(CourseTestCase):
category
=
'
problem
'
,
display_name
=
'
Test Problem
'
,
publish_item
=
publish_item
,
data
=
'
<problem><pre><code>x=10</code></pre><multiplechoiceresponse></multiplechoiceresponse></problem>
'
,
data
=
'
<problem><pre><code>x=10 print(
"
hello
\n
"
)</code></pre>
'
'
<multiplechoiceresponse></multiplechoiceresponse></problem>
'
,
)
def
get_problem_content
(
self
,
block_location
):
...
...
@@ -1075,10 +1076,9 @@ class TestCourseExportImportProblem(CourseTestCase):
"""
Asserts that problems
'
data is as expected with pre-tag content maintained.
"""
expected_problem_content
=
'
<problem>
\n
<pre><code>x=10</code></pre>
\n
'
\
'
<multiplechoiceresponse/>
\n
</problem>
\n
'
expected_problem_content
=
'
<problem>
\n
<pre>
\n
<code>x=10
print(
"
hello
\n
"
)
</code>
\n
</pre>
\n
'
\
'
<multiplechoiceresponse/>
\n
</problem>
\n
'
problem_content
=
self
.
get_problem_content
(
course_location
)
self
.
assertEqual
(
expected_problem_content
,
problem_content
)
def
test_problem_content_on_course_export_import
(
self
):
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/raw_module.py
+
1
−
1
View file @
f264e5dd
...
...
@@ -29,7 +29,7 @@ class RawMixin(object):
data
=
etree
.
tostring
(
xml_object
,
pretty_print
=
True
,
encoding
=
'
unicode
'
)
if
pre_tag_data
:
for
index
,
pre_tag
in
enumerate
(
re
.
findall
(
PRE_TAG_REGEX
,
data
)):
data
=
re
.
sub
(
re
.
escape
(
pre_tag
)
,
pre_tag_data
[
index
].
decode
(),
data
)
data
=
re
.
sub
(
pre_tag
,
pre_tag_data
[
index
].
decode
(),
data
)
return
{
'
data
'
:
data
},
[]
def
definition_to_xml
(
self
,
resource_fs
):
...
...
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