'test to apply an invalid registration code
when updating the registration code information.'

def test_apply_invalid_reg_code_when_updating_code_information(self):

    data = {'registration_code': 'invalid_registration_code', 'action_type': 'unredeem_registration_code'}
    response = self.client.post(self.registration_code_detail_url, data)
    self.assertEqual(response.status_code, 400)
    json_dict = json.loads(response.content)
    message = _('The    enrollment    code    ({code})    was    not    found    for    the    {course_name}    course.').format(course_name=self.course.display_name, code=data['registration_code'])
    self.assertEqual(message, json_dict['message'])
