'Test that user names >64 characters are properly truncated.'

def test_username_length(self):

    self._stubs_v2()
    long_user_name = (('U' * 64) + 'S')
    good_user_name = long_user_name[(-64):]
    self.mock_ks_client.users = self.m.CreateMockAnything()
    mock_user = self.m.CreateMockAnything()
    self.mock_ks_client.users.create(good_user_name, 'password', mox.IgnoreArg(), enabled=True, tenant_id=mox.IgnoreArg()).AndReturn(mock_user)
    self.mock_ks_client.roles = self.m.CreateMockAnything()
    self.mock_ks_client.roles.list().AndReturn([])
    self.m.ReplayAll()
    self.ctx.trust_id = None
    heat_ks_client = heat_keystoneclient.KeystoneClientV2(self.ctx)
    heat_ks_client.create_stack_user(long_user_name, password='password')
