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
dadc47c2
Commit
dadc47c2
authored
Mar 16, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6167 from fmyzjs/patch-5
To support UNICODE xblock.location
parents
fd0e389c
ef257fb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
cms/djangoapps/contentstore/views/helpers.py
+1
-1
cms/djangoapps/contentstore/views/tests/test_helpers.py
+13
-0
No files found.
cms/djangoapps/contentstore/views/helpers.py
View file @
dadc47c2
...
...
@@ -110,7 +110,7 @@ def xblock_studio_url(xblock, parent_xblock=None):
elif
category
in
(
'chapter'
,
'sequential'
):
return
u'{url}?show={usage_key}'
.
format
(
url
=
reverse_course_url
(
'course_handler'
,
xblock
.
location
.
course_key
),
usage_key
=
urllib
.
quote
(
unicode
(
xblock
.
location
))
usage_key
=
urllib
.
quote
(
unicode
(
xblock
.
location
)
.
encode
(
'utf8'
)
)
)
elif
category
==
'library'
:
library_key
=
xblock
.
location
.
course_key
...
...
cms/djangoapps/contentstore/views/tests/test_helpers.py
View file @
dadc47c2
...
...
@@ -5,6 +5,8 @@ Unit tests for helpers.py.
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.views.helpers
import
xblock_studio_url
,
xblock_type_display_name
from
xmodule.modulestore.tests.factories
import
ItemFactory
,
LibraryFactory
from
xmodule.modulestore.xml
import
XMLModuleStore
from
xmodule.tests
import
DATA_DIR
from
django.utils
import
http
...
...
@@ -55,6 +57,17 @@ class HelpersTestCase(CourseTestCase):
expected_url
=
u'/library/{}'
.
format
(
unicode
(
library
.
location
.
library_key
))
self
.
assertEqual
(
xblock_studio_url
(
library
),
expected_url
)
def
test_unicode_xblock_studio_url
(
self
):
#import unicode course
modulestore
=
XMLModuleStore
(
DATA_DIR
,
course_dirs
=
[
'2014_Uni'
])
courses
=
modulestore
.
get_courses
()
course
=
courses
[
0
]
# Verify course URL
course_url
=
http
.
urlquote
(
'/course/{}'
.
format
(
course
.
id
))
self
.
assertEqual
(
xblock_studio_url
(
course
),
course_url
)
def
test_xblock_type_display_name
(
self
):
# Verify chapter type display name
...
...
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