def add_entrance_exam_milestone(course, entrance_exam):
 namespace_choices = get_namespace_choices()
 milestone_relationship_types = get_milestone_relationship_types()
 milestone_namespace = generate_milestone_namespace(namespace_choices.get('ENTRANCE_EXAM'), course.id)
 milestone = add_milestone({'name': 'Test Milestone', 'namespace': milestone_namespace, 'description': 'Testing Courseware Entrance Exam Chapter'})
 add_course_milestone(unicode(course.id), milestone_relationship_types['REQUIRES'], milestone)
 add_course_content_milestone(unicode(course.id), unicode(entrance_exam.location), milestone_relationship_types['FULFILLS'], milestone)

def add_entrance_exam_milestone ( course , entrance_exam ) : namespace_choices = get_namespace_choices ( ) milestone_relationship_types = get_milestone_relationship_types ( ) milestone_namespace = generate_milestone_namespace ( namespace_choices . get ( 'ENTRANCE_EXAM' ) , course . id ) milestone = add_milestone ( { 'name' : 'Test Milestone' , 'namespace' : milestone_namespace , 'description' : 'Testing Courseware Entrance Exam Chapter' } ) add_course_milestone ( unicode ( course . id ) , milestone_relationship_types [ 'REQUIRES' ] , milestone ) add_course_content_milestone ( unicode ( course . id ) , unicode ( entrance_exam . location ) , milestone_relationship_types [ 'FULFILLS' ] , milestone )
adds the milestone for given entrance_exam in course args: course : course object in which the extrance_exam is located entrance_exam : the entrance exam to be added as a milestone .