def test_model(clients_to_test, set_to_use='test'):
    """Tests self.model on given clients.
    Tests model on self.selected_clients if clients_to_test=None.

    Args:
        clients_to_test: list of Client objects.
        set_to_use: dataset to test on. Should be in ['train', 'test'].
    """
    metrics = {}
    encoders = {}

    for client in clients_to_test:
        encoder, c_metrics = client.test(set_to_use)
        metrics[client.id] = c_metrics
        encoders[client.id] = encoder

    return encoders, metrics