'Create a new course run and course modes.
All date-related arguments are relative to the current date-time (now) unless otherwise specified.
Both audit and verified `CourseMode` objects will be created for the course run.
Arguments:
days_till_end (int): Number of days until the course ends.
days_till_start (int): Number of days until the course starts.
days_till_upgrade_deadline (int): Number of days until the course run\'s upgrade deadline.
days_till_verification_deadline (int): Number of days until the course run\'s verification deadline. If this
value is set to `None` no deadline will be verification deadline will be created.'

def create_course_run(self, days_till_start=1, days_till_end=14, days_till_upgrade_deadline=4, days_till_verification_deadline=14):

    now = datetime.now(utc)
    course = CourseFactory.create(start=(now + timedelta(days=days_till_start)))
    course.end = None
    if (days_till_end is not None):
        course.end = (now + timedelta(days=days_till_end))
    CourseModeFactory(course_id=course.id, mode_slug=CourseMode.AUDIT)
    CourseModeFactory(course_id=course.id, mode_slug=CourseMode.VERIFIED, expiration_datetime=(now + timedelta(days=days_till_upgrade_deadline)))
    if (days_till_verification_deadline is not None):
        VerificationDeadline.objects.create(course_key=course.id, deadline=(now + timedelta(days=days_till_verification_deadline)))
    return course
