'Create entity test data.
:param entity_type: type of entity to create, e.g. \'user\', group\' etc.
:param number: number of entities to create,
:param domain_id: if not defined, all users will be created in the
default domain.
:param name_dict: optional dict containing entity number and name pairs'

def _create_test_data(self, entity_type, number, domain_id=None, name_dict=None):

    entity_list = []
    if (domain_id is None):
        domain_id = CONF.identity.default_domain_id
    name_dict = (name_dict or {})
    for x in range(number):
        name = name_dict.get(x, uuid.uuid4().hex)
        new_entity = self._create_one_entity(entity_type, domain_id, name)
        entity_list.append(new_entity)
    return entity_list
