'test computed fields with access right errors'

def test_11_computed_access(self):

    User = self.env['res.users']
    user1 = User.create({'name': 'Aaaah', 'login': 'a'})
    user2 = User.create({'name': 'Boooh', 'login': 'b'})
    user3 = User.create({'name': 'Crrrr', 'login': 'c'})
    self.env['ir.rule'].create({'model_id': self.env['ir.model'].search([('model', '=', 'res.users')]).id, 'domain_force': ("[('id',    '!=',    %d)]" % user2.id)})
    users = ((user1 + user2) + user3).sudo(self.env.ref('base.user_demo'))
    (user1, user2, user3) = users
    user1.company_type
    with self.assertRaises(AccessError):
        user2.company_type
    user3.company_type
