'Helper to create an xblock with a start date, optionally publishing it'

def _create_xblock_with_start_date(self, name, start_date, publish=False, visible_to_staff_only=False):

    vertical = modulestore().create_item(self.dummy_user, self.course.location.course_key, 'vertical', name, fields={'start': start_date, 'visible_to_staff_only': visible_to_staff_only})
    if publish:
        modulestore().publish(vertical.location, self.dummy_user)
    return vertical
