def METHOD_NAME(self):
    """
    Test that when schedule start date is before course start or
    enrollment date, content_availability_date is set to max of course start
    or enrollment date
    """
    enrollment = CourseEnrollmentFactory.create(course=self.course)
    CourseModeFactory.create(
        course_id=enrollment.course.id,
        mode_slug=CourseMode.VERIFIED,
    )
    CourseModeFactory.create(
        course_id=enrollment.course.id,
        mode_slug=CourseMode.AUDIT,
    )
    Schedule.objects.update(start_date=datetime(2017, 1, 1, tzinfo=UTC))
    content_availability_date = max(enrollment.created, enrollment.course.start)
    access_duration = get_user_course_duration(enrollment.user, enrollment.course)
    expected_course_expiration_date = content_availability_date + access_duration
    duration_limit_upgrade_deadline = get_user_course_expiration_date(enrollment.user, enrollment.course)
    assert duration_limit_upgrade_deadline is not None
    assert duration_limit_upgrade_deadline == expected_course_expiration_date