@test.create_stubs({api.keystone: ('user_create',
                                       'get_default_domain',
                                       'add_tenant_user_role',
                                       'tenant_list',
                                       'get_default_role',
                                       'roles_for_user',
                                       'role_list')})
    def test_create_with_empty_email(self):
        user = self.users.get(id="5")
        domain = self._get_default_domain()
        domain_id = domain.id
        role = self.roles.first()
        api.keystone.get_default_domain(IgnoreArg()) \
            .AndReturn(domain)
        api.keystone.get_default_domain(IgnoreArg(), False) \
            .AndReturn(domain)

        if 3 >= api.keystone.VERSIONS.active:
            api.keystone.tenant_list(
                IgnoreArg(), domain=domain.id).AndReturn(
                [self.tenants.list(), False])
        else:
            api.keystone.tenant_list(
                IgnoreArg(), user=user.id).AndReturn(
                [self.tenants.list(), False])

        api.keystone.user_create(IgnoreArg(),
                                 name=user.name,
                                 description=user.description,
                                 email=user.email,
                                 password=user.password,
                                 project=self.tenant.id,
                                 enabled=True,
                                 domain=domain_id).AndReturn(user)
        api.keystone.role_list(IgnoreArg()).AndReturn(self.roles.list())
        api.keystone.get_default_role(IgnoreArg()).AndReturn(role)
        api.keystone.add_tenant_user_role(IgnoreArg(), self.tenant.id,
                                          user.id, role.id)
        api.keystone.roles_for_user(IgnoreArg(), user.id, self.tenant.id)

        self.mox.ReplayAll()
        formData = {'method': 'CreateUserForm',
                    'domain_id': domain_id,
                    'name': user.name,
                    'description': user.description,
                    'email': "",
                    'enabled': True,
                    'password': user.password,
                    'project': self.tenant.id,
                    'role_id': self.roles.first().id,
                    'confirm_password': user.password}
        res = self.client.post(USER_CREATE_URL, formData)

        self.assertNoFormErrors(res)
        self.assertMessageCount(success=1)
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/identity/users/tests.py/UsersViewTests.test_create_with_empty_email/swapped operands of `>=`