'Tests check the scenario where one course which has an asset with percentage(%) in its
name, it should re-run successfully.'

def test_space_in_asset_name_for_rerun_course(self):

    org = 'edX'
    course_number = 'CS101'
    course_run = '2015_Q1'
    display_name = 'rerun'
    fields = {'display_name': display_name}
    course_assets = set([u'subs_Introduction%20To%20New.srt.sjson'])
    course = CourseFactory.create(org=org, number=course_number, run=course_run, display_name=display_name, default_store=ModuleStoreEnum.Type.split)
    asset_key = course.id.make_asset_key('asset', 'subs_Introduction%20To%20New.srt.sjson')
    content = StaticContent(asset_key, 'Dummy    assert', 'application/json', 'dummy    data')
    contentstore().save(content)
    (assets, count) = contentstore().get_all_content_for_course(course.id)
    self.assertEqual(count, 1)
    self.assertEqual(set([asset['asset_key'].block_id for asset in assets]), course_assets)
    split_rerun_id = CourseLocator(org=org, course=course_number, run='2012_Q2')
    CourseRerunState.objects.initiated(course.id, split_rerun_id, self.user, fields['display_name'])
    result = rerun_course.delay(unicode(course.id), unicode(split_rerun_id), self.user.id, json.dumps(fields, cls=EdxJSONEncoder))
    self.assertEqual(result.get(), 'succeeded')
    rerun_state = CourseRerunState.objects.find_first(course_key=split_rerun_id)
    self.assertEqual(rerun_state.state, CourseRerunUIStateManager.State.SUCCEEDED)
