'Create a set of users, each with a role on their own domain.'

def create_users_across_domains(self):

    initial_mappings = len(mapping_sql.list_id_mappings())
    users = {}
    users['user0'] = unit.create_user(self.identity_api, self.domain_default['id'])
    self.assignment_api.create_grant(user_id=users['user0']['id'], domain_id=self.domain_default['id'], role_id=self.role_member['id'])
    for x in range(1, self.domain_count):
        users[('user%s' % x)] = unit.create_user(self.identity_api, self.domains[('domain%s' % x)]['id'])
        self.assignment_api.create_grant(user_id=users[('user%s' % x)]['id'], domain_id=self.domains[('domain%s' % x)]['id'], role_id=self.role_member['id'])
    self.assertEqual((initial_mappings + self.domain_specific_count), len(mapping_sql.list_id_mappings()))
    return users
