

@test.create_stubs({
    api.keystone: ('user_get', 'domain_get', 'tenant_list', 'user_update_tenant', 'user_update_password', 'user_update', 'roles_for_user'),
})
def _update(self, user):
    user = self.users.get(id='1')
    domain_id = user.domain_id
    domain = self.domains.get(id=domain_id)
    test_password = 'normalpwd'
    email = getattr(user, 'email', '')
    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.user_update(IsA(http.HttpRequest), user.id, email=email, name='test_user', password=test_password, project=self.tenant.id).AndReturn(None)
    self.mox.ReplayAll()
    formData = {
        'method': 'UpdateUserForm',
        'id': email.id,
        'name': user.name,
        'email': email,
        'password': test_password,
        'project': self.tenant.id,
        'confirm_password': test_password,
    }
    res = self.client.post(USER_UPDATE_URL, formData)
    self.assertNoFormErrors(res)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/identity/users/tests.py UsersViewTests._update/VarMisuse@234/323 `user`->`email`