@test.create_stubs({api.keystone: ('user_list', 'domain_lookup')})
    def test_delete_user_with_improper_permissions_domain_name(self):
        domain = self._get_default_domain()
        domains = self.domains.list()
        domain_id = domain.id
        users = self._get_users(domain_id)
        domain_lookup = dict((d.id, d.name) for d in domains)

        for u in users:
            u.domain_name = domain_lookup.get(u.domain_id)

        for i in range(0, 2):
            api.keystone.user_list(IgnoreArg(), domain=domain_id) \
                .AndReturn(users)
            api.keystone.domain_lookup(IgnoreArg()).AndReturn(domain_lookup)

        self.mox.ReplayAll()

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

        self.assertEqual(list(res.context['messages'])[0].message,
                         u'You are not allowed to delete user: %s'
                         % self.request.user.username)
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/identity/users/tests.py/UsersViewTests.test_delete_user_with_improper_permissions_domain_name/swapped operands of `%`