tests/system/action/base.py
def execute_action_internally(
        self, action_name: str, data: Dict[str, Any], user_id: int = 0
    ) -> None:
        """
        Shorthand to execute an action internally where all permissions etc. are ignored.
        Useful when an action is just execute for the end result and not for testing it.
        """
        ActionClass = actions_map[action_name]
        action = ActionClass(
            self.services, self.datastore, RelationManager(self.datastore), MagicMock()
        )
        action_data = deepcopy(data)
        with self.datastore.get_database_context():
            write_request, _ = action.perform([action_data], user_id, internal=True)
        if write_request:
            self.datastore.write(write_request)
        self.datastore.reset()

        Shorthand to execute an action internally where all permissions etc. are ignored.
        Useful when an action is just execute for the end result and not for testing it.
        
Shorthand to execute an action internally where all permissions etc. are ignored.
Useful when an action is just execute for the end result and not for testing it.
Shorthand to execute an action internally where all permissions etc . are ignored . Useful when an action is just execute for the end result and not for testing it .
def execute_action_internally(
        self, action_name: str, data: Dict[str, Any], user_id: int = 0
    ) -> None:
        ActionClass = actions_map[action_name]
        action = ActionClass(
            self.services, self.datastore, RelationManager(self.datastore), MagicMock()
        )
        action_data = deepcopy(data)
        with self.datastore.get_database_context():
            write_request, _ = action.perform([action_data], user_id, internal=True)
        if write_request:
            self.datastore.write(write_request)
        self.datastore.reset()
def execute_action_internally ( self , action_name : str , data : Dict [ str , Any ] , user_id : int = 0 ) -> None : ActionClass = actions_map [ action_name ] action = ActionClass ( self . services , self . datastore , RelationManager ( self . datastore ) , MagicMock ( ) ) action_data = deepcopy ( data ) with self . datastore . get_database_context ( ) : write_request , _ = action . perform ( [ action_data ] , user_id , internal = True ) if write_request : self . datastore . write ( write_request ) self . datastore . reset ( )
Shorthand to execute an action internally where all permissions etc.
Shorthand to execute an action internally where all permissions etc .
"""
        Shorthand to execute an action internally where all permissions etc. are ignored.
        Useful when an action is just execute for the end result and not for testing it.
        """
self
action_name
str
data
Dict[str, Any]
user_id
int