Skip to content
Snippets Groups Projects
Commit 8d01a36e authored by Ned Batchelder's avatar Ned Batchelder
Browse files

Merge pull request #1742 from edx/ned/cherry-pick-pr-1740

Ned/cherry pick pr 1740
parents fdf7ea2c 3ab17d75
No related branches found
No related tags found
No related merge requests found
......@@ -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://)?
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment