'Set the upgrade and verification deadlines.
Arguments:
course_key (CourseKey): Identifier for the course.
Keyword Arguments:
upgrade_deadline (datetime): Datetime after which a user cannot
upgrade to a verified mode.
verification_deadline (datetime): Datetime after which a user cannot
submit an initial verification attempt.'

def _set_deadlines(self, course_key, upgrade_deadline=None, verification_deadline=None, mode_slug='verified'):

    mode = CourseMode.objects.get(course_id=course_key, mode_slug=mode_slug)
    mode.expiration_datetime = upgrade_deadline
    mode.save()
    VerificationDeadline.set_deadline(course_key, verification_deadline)
