'Use a valid registration code to upgrade from honor to verified mode.'

def test_upgrade_from_valid_reg_code(self):

    course_key = self.course_key.to_deprecated_string()
    self._add_course_mode(mode_slug='verified')
    self.add_reg_code(course_key, mode_slug='verified')
    CourseEnrollment.enroll(self.user, self.course_key, mode=CourseMode.HONOR)
    self.login_user()
    (current_enrollment, __) = CourseEnrollment.enrollment_mode_for_user(self.user, self.course_key)
    self.assertEquals('honor', current_enrollment)
    redeem_url = reverse('register_code_redemption', args=[self.reg_code])
    response = self.client.get(redeem_url)
    self.assertEquals(response.status_code, 200)
    self.assertIn('Activate    Course    Enrollment', response.content)
    response = self.client.post(redeem_url)
    self.assertEquals(response.status_code, 200)
    (current_enrollment, __) = CourseEnrollment.enrollment_mode_for_user(self.user, self.course_key)
    self.assertEquals('verified', current_enrollment)
