@test.create_stubs({api.keystone: ('user_list',)})
    def test_disabling_current_user(self):
        domain = self._get_default_domain()
        domain_id = domain.id
        users = self._get_users(domain_id)
        for i in range(0, 2):
            api.keystone.user_list(IgnoreArg(), domain=domain_id) \
                .AndReturn(users)

        self.mox.ReplayAll()

        formData = {'action': 'users__toggle__%s' % self.request.user.id}
        res = self.client.post(USERS_INDEX_URL, formData, follow=True)

        self.assertEqual(list(res.context['messages'])[0].message,
                         u'You cannot disable the user you are currently '
                         u'logged in as.')
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/identity/users/tests.py/UsersViewTests.test_disabling_current_user/original