

@test.create_stubs({
    api.keystone: ('user_update_enabled', 'user_list'),
})
def test_enable_user(self):
    domain = self._get_default_domain()
    domain_id = domain.id
    user = self.users.get(id='2')
    users = self._get_users(domain_id)
    user.enabled = False
    api.keystone.user_list(IgnoreArg(), domain=domain_id).AndReturn(users)
    api.keystone.user_update_enabled(IgnoreArg(), user.id, True).AndReturn(user)
    self.mox.ReplayAll()
    formData = {
        'action': ('users__toggle__%s' % user.id),
    }
    res = self.client.post(USERS_INDEX_URL, formData)
    self.assertRedirectsNoFollow(res, USERS_INDEX_URL)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/identity/users/tests.py UsersViewTests.test_enable_user/original