'Test creating a stack domain user, fallback path.'

def test_create_stack_domain_user_legacy_fallback(self):

    self._clear_domain_override()
    ctx = utils.dummy_context()
    ctx.trust_id = None
    self._stubs_auth()
    self.mock_ks_v3_client.users = self.m.CreateMockAnything()
    mock_user = self.m.CreateMockAnything()
    mock_user.id = 'auser123'
    self.mock_ks_v3_client.users.create(name='auser', password='password', default_project=ctx.tenant_id).AndReturn(mock_user)
    self.mock_ks_v3_client.roles = self.m.CreateMockAnything()
    self.mock_ks_v3_client.roles.list(name='heat_stack_user').AndReturn(self._mock_roles_list())
    self.mock_ks_v3_client.roles.grant(project=ctx.tenant_id, role='4546', user='auser123').AndReturn(None)
    self.m.ReplayAll()
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    heat_ks_client.create_stack_domain_user(username='auser', project_id='aproject', password='password')
