Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
8d01a36e
Commit
8d01a36e
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Plain Diff
Merge pull request #1742 from edx/ned/cherry-pick-pr-1740
Ned/cherry pick pr 1740
parents
fdf7ea2c
3ab17d75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/modulestore/parsers.py
+1
-1
1 addition, 1 deletion
common/lib/xmodule/xmodule/modulestore/parsers.py
common/lib/xmodule/xmodule/modulestore/tests/test_locators.py
+10
-0
10 additions, 0 deletions
...on/lib/xmodule/xmodule/modulestore/tests/test_locators.py
with
11 additions
and
1 deletion
common/lib/xmodule/xmodule/modulestore/parsers.py
+
1
−
1
View file @
8d01a36e
...
...
@@ -7,7 +7,7 @@ BLOCK_PREFIX = r"block/"
# Prefix for the version portion of a locator URL, when it is preceded by a course ID
VERSION_PREFIX
=
r
"
version/
"
ALLOWED_ID_CHARS
=
r
'
[a-zA-Z0-9_\-~.]
'
ALLOWED_ID_CHARS
=
r
'
[a-zA-Z0-9_\-~.
:
]
'
URL_RE_SOURCE
=
r
"""
(?P<tag>edx://)?
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/tests/test_locators.py
+
10
−
0
View file @
8d01a36e
...
...
@@ -249,6 +249,16 @@ class LocatorTest(TestCase):
version_guid
=
ObjectId
(
test_id_loc
)
)
def
test_colon_name
(
self
):
"""
It seems we used to use colons in names; so, ensure they
'
re acceptable.
"""
course_id
=
'
mit.eecs-1
'
branch
=
'
foo
'
usage_id
=
'
problem:with-colon~2
'
testobj
=
BlockUsageLocator
(
course_id
=
course_id
,
branch
=
branch
,
usage_id
=
usage_id
)
self
.
check_block_locn_fields
(
testobj
,
'
Cannot handle colon
'
,
course_id
=
course_id
,
branch
=
branch
,
block
=
usage_id
)
def
test_repr
(
self
):
testurn
=
'
mit.eecs.6002x/
'
+
BRANCH_PREFIX
+
'
published/
'
+
BLOCK_PREFIX
+
'
HW3
'
testobj
=
BlockUsageLocator
(
course_id
=
testurn
)
...
...
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