'Test create_trust_context when creating a trust.'

def test_create_trust_context_trust_create_norole(self):

    self._stub_admin_auth()
    (mock_auth, mock_auth_ref) = self._stubs_auth(user_id='5678', project_id='42', stub_trust_context=True)
    cfg.CONF.set_override('deferred_auth_method', 'trusts')
    cfg.CONF.set_override('trusts_delegated_roles', ['heat_stack_owner'])
    self.mock_ks_v3_client.trusts = self.m.CreateMockAnything()
    self.mock_ks_v3_client.trusts.create(trustor_user='5678', trustee_user='1234', project='42', impersonation=True, role_names=['heat_stack_owner']).AndRaise(kc_exception.NotFound())
    self.m.ReplayAll()
    ctx = utils.dummy_context()
    ctx.trust_id = None
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    exc = self.assertRaises(exception.MissingCredentialError, heat_ks_client.create_trust_context)
    expected = "Missing    required    credential:    roles    ['heat_stack_owner']"
    self.assertIn(expected, six.text_type(exc))
