

@test.create_stubs({
    api.keystone: ('user_get', 'domain_get', 'tenant_list', 'user_update_tenant', 'keystone_can_edit_user', 'roles_for_user'),
})
def test_update_with_keystone_can_edit_user_false(self):
    user = self.users.get(id='1')
    domain_id = user.domain_id
    domain = self.domains.get(id=domain_id)
    api.keystone.user_get(IsA(http.HttpRequest), '1', admin=True).AndReturn(user)
    api.keystone.domain_get(IsA(http.HttpRequest), domain_id).AndReturn(domain)
    api.keystone.tenant_list(IgnoreArg(), domain=domain_id, user=user.id).AndReturn([self.tenants.list(), False])
    api.keystone.keystone_can_edit_user().AndReturn(False)
    api.keystone.keystone_can_edit_user().AndReturn(False)
    self.mox.ReplayAll()
    formData = {
        'method': 'UpdateUserForm',
        'id': user.id,
        'name': user.name,
        'project': self.tenant.id,
    }
    res = self.client.post(USER_UPDATE_URL, user)
    self.assertNoFormErrors(res)
    self.assertMessageCount(error=1)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/identity/users/tests.py UsersViewTests.test_update_with_keystone_can_edit_user_false/VarMisuse@231/321 `formData`->`user`