'Verify that program data is supplemented with the student\'s enrollment status.'

@ddt.data((False, None, False), (True, MODES.audit, True), (True, MODES.verified, False))
@ddt.unpack
@mock.patch((UTILS_MODULE + '.CourseMode.mode_for_course'))
def test_student_enrollment_status(self, is_enrolled, enrolled_mode, is_upgrade_required, mock_get_mode):

    expected_upgrade_url = '{root}/{path}?sku={sku}'.format(root=ECOMMERCE_URL_ROOT, path=self.checkout_path.strip('/'), sku=self.sku)
    update_commerce_config(enabled=True, checkout_page=self.checkout_path)
    mock_mode = mock.Mock()
    mock_mode.sku = self.sku
    mock_get_mode.return_value = mock_mode
    if is_enrolled:
        CourseEnrollmentFactory(user=self.user, course_id=self.course.id, mode=enrolled_mode)
    data = ProgramDataExtender(self.program, self.user).extend()
    self._assert_supplemented(data, is_enrolled=is_enrolled, upgrade_url=(expected_upgrade_url if is_upgrade_required else None))
