'Tests the use of reg codes on verified courses, expired or active.'

@ddt.data(True, False)
def test_reg_code_uses_unknown_mode(self, expired_mode):

    course_key = self.course_key.to_deprecated_string()
    expiration_date = (self.yesterday if expired_mode else self.tomorrow)
    self._add_course_mode(mode_slug='verified', expiration_date=expiration_date)
    self.add_reg_code(course_key, mode_slug='bananas')
    self.add_course_to_user_cart(self.course_key)
    resp = self.client.post(reverse('register_code_redemption', args=[self.reg_code]), HTTP_HOST='localhost')
    self.assertEqual(resp.status_code, 200)
    self.assertIn(self.course.display_name.encode('utf-8'), resp.content)
    self.assertIn('error    processing    your    redeem    code', resp.content)
