addons14/base_technical_features/tests/test_base_technical_features.py
def test03_user_access(self):
        """ Setting the user pref raises an access error if the user is not \
        in group_no_one """
        user = self.env["res.users"].create(
            {
                "name": "Test user technical features",
                "login": "testusertechnicalfeatures",
                "groups_id": [(6, 0, [])],
            }
        )
        self.env.user._compute_show_technical_features()
        self.env.user._compute_technical_features()
        with api.Environment.manage():
            env = api.Environment(self.env.cr, user.id, self.env.context)
            with self.assertRaises(AccessError):
                env["res.users"].browse(user.id).write({"technical_features": True})
        with self.assertRaises(AccessError):
            user.write({"technical_features": True})
        user.write({"groups_id": [(4, self.env.ref("base.group_no_one").id)]})
        with api.Environment.manage():
            env = api.Environment(self.env.cr, user.id, self.env.context)
            env["res.users"].browse(user.id).write({"technical_features": True})
 Setting the user pref raises an access error if the user is not \
        in group_no_one 
Setting the user pref raises an access error if the user is not \
in group_no_one
Setting the user pref raises an access error if the user is not \ in group_no_one
def test03_user_access(self):
        user = self.env["res.users"].create(
            {
                "name": "Test user technical features",
                "login": "testusertechnicalfeatures",
                "groups_id": [(6, 0, [])],
            }
        )
        self.env.user._compute_show_technical_features()
        self.env.user._compute_technical_features()
        with api.Environment.manage():
            env = api.Environment(self.env.cr, user.id, self.env.context)
            with self.assertRaises(AccessError):
                env["res.users"].browse(user.id).write({"technical_features": True})
        with self.assertRaises(AccessError):
            user.write({"technical_features": True})
        user.write({"groups_id": [(4, self.env.ref("base.group_no_one").id)]})
        with api.Environment.manage():
            env = api.Environment(self.env.cr, user.id, self.env.context)
            env["res.users"].browse(user.id).write({"technical_features": True})
def test03_user_access ( self ) : user = self . env [ "res.users" ] . create ( { "name" : "Test user technical features" , "login" : "testusertechnicalfeatures" , "groups_id" : [ ( 6 , 0 , [ ] ) ] , } ) self . env . user . _compute_show_technical_features ( ) self . env . user . _compute_technical_features ( ) with api . Environment . manage ( ) : env = api . Environment ( self . env . cr , user . id , self . env . context ) with self . assertRaises ( AccessError ) : env [ "res.users" ] . browse ( user . id ) . write ( { "technical_features" : True } ) with self . assertRaises ( AccessError ) : user . write ( { "technical_features" : True } ) user . write ( { "groups_id" : [ ( 4 , self . env . ref ( "base.group_no_one" ) . id ) ] } ) with api . Environment . manage ( ) : env = api . Environment ( self . env . cr , user . id , self . env . context ) env [ "res.users" ] . browse ( user . id ) . write ( { "technical_features" : True } )
Setting the user pref raises an access error if the user is not \
in group_no_one
Setting the user pref raises an access error if the user is not \ in group_no_one
""" Setting the user pref raises an access error if the user is not \
        in group_no_one """
self