'Verify the contents of the course rerun action'

def verify_rerun_course(self, source_course_key, destination_course_key, destination_display_name):

    rerun_state = CourseRerunState.objects.find_first(course_key=destination_course_key)
    expected_states = {'state': CourseRerunUIStateManager.State.SUCCEEDED, 'display_name': destination_display_name, 'source_course_key': source_course_key, 'course_key': destination_course_key, 'should_display': True}
    for (field_name, expected_value) in expected_states.iteritems():
        self.assertEquals(getattr(rerun_state, field_name), expected_value)
    self.assertTrue(CourseEnrollment.is_enrolled(self.user, destination_course_key))
    self.assertInCourseListing(source_course_key)
    self.assertInCourseListing(destination_course_key)
