'Make sure that url_names are only mangled once.'

def test_url_name_mangling(self):

    modulestore = XMLModuleStore(DATA_DIR, source_dirs=['toy'])
    toy_id = CourseKey.from_string('edX/toy/2012_Fall')
    course = modulestore.get_course(toy_id)
    chapters = course.get_children()
    ch1 = chapters[0]
    sections = ch1.get_children()
    self.assertEqual(len(sections), 4)
    for i in (2, 3):
        video = sections[i]
        print 'video    {0}    url_name:    {1}'.format(i, video.url_name)
        self.assertEqual(len(video.url_name), (len('video_') + 12))
