'Test error message if invalid user name is given.'

def test_invalid_user_name_error(self):

    invalid_user = 'test_invalid_user_name'
    self.certificate_invalidation_data.update({'user': invalid_user})
    response = self.client.post(self.url, data=json.dumps(self.certificate_invalidation_data), content_type='application/json')
    self.assertEqual(response.status_code, 400)
    res_json = json.loads(response.content)
    self.assertEqual(res_json['message'], u'{user}    does    not    exist    in    the    LMS.    Please    check    your    spelling    and    retry.'.format(user=invalid_user))
