'Verify the view returns HTTP status 400 if an invalid registration code is passed.
Also, verify the data returned includes a message indicating the error,
and the is_registration_code_valid is set to False.'

def test_look_up_invalid_registration_code(self):

    data = {'registration_code': 'invalid_reg_code'}
    response = self.client.get(self.lookup_code_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'])
    self.assertFalse(json_dict['is_registration_code_valid'])
    self.assertFalse(json_dict['is_registration_code_redeemed'])
