def test_client_post_invalid_action(self, client, token_generator):
    headers = {'content-type': 'application/json', 'authorization': f'bearer {token_generator.get_token(client)}'}
    user_ids = post_users(USERS, client, token_generator.get_token(client))
    client_ids = self._post_clients(client, user_ids, token_generator)
    client_to_patch = client_ids[0]
    response = client.post('/clients?action=some_invalid_action', data=json.dumps({'id': client_to_patch}), headers=headers)
    expect(response.status_code).to(equal(422))
    expect(response.json['messages']).to(contain('Invalid query param!'))
    self._cleanup(client, token_generator, user_ids=user_ids)
def test_client_post_invalid_action(self, client, token_generator):
    headers = {'content-type': 'application/json', 'authorization': f'bearer {token_generator.get_token(client)}'}
    user_ids = post_users(USERS, client, token_generator.get_token(client))
    client_ids = self._post_clients(client, user_ids, token_generator)
    client_to_patch = client_ids[0]
    response = client.post('/clients?action=some_invalid_action', data=json.dumps({'id': client_to_patch}), headers=headers)
    expect(response.status_code).to(equal(422))
    expect(response.json['messages']).to(contain('Invalid query param!'))
    self._cleanup(client, token_generator, user_ids=user_ids)