'Check that using odd characters in block id don\'t break ability to add and retrieve block.'

def test_encoded_naming(self):

    course_key = CourseLocator(org='guestx', course='contender', run='run', branch=BRANCH_NAME_DRAFT)
    parent_locator = BlockUsageLocator(course_key, 'course', block_id='head345679')
    chapter_locator = BlockUsageLocator(course_key, 'chapter', block_id='foo.bar_-~:0')
    modulestore().create_child('anotheruser', parent_locator, 'chapter', block_id=chapter_locator.block_id, fields={'display_name': 'chapter    99'})
    new_module = modulestore().get_item(chapter_locator)
    self.assertEqual(new_module.location.block_id, 'foo.bar_-~:0')
    new_payload = '<problem>empty</problem>'
    problem_locator = BlockUsageLocator(course_key, 'problem', block_id='prob.bar_-~:99a')
    modulestore().create_child('anotheruser', chapter_locator, 'problem', block_id=problem_locator.block_id, fields={'display_name': 'chapter    99', 'data': new_payload})
    new_module = modulestore().get_item(problem_locator)
    self.assertEqual(new_module.location.block_id, problem_locator.block_id)
    chapter = modulestore().get_item(chapter_locator)
    self.assertIn(problem_locator, version_agnostic(chapter.children))
