'test to redeem inactive registration code and
it returns an error.'

def test_inactive_registration_code_returns_error(self):

    course_key = self.course_key.to_deprecated_string()
    self.add_reg_code(course_key, is_valid=False)
    self.add_course_to_user_cart(self.course_key)
    resp = self.client.post(reverse('shoppingcart.views.use_code'), {'code': self.reg_code})
    self.assertEqual(resp.status_code, 400)
    self.assertIn('This    enrollment    code    ({enrollment_code})    is    no    longer    valid.'.format(enrollment_code=self.reg_code), resp.content)
