def use_user(self, user_db):
        """
        Select a user which is to be used by the HTTP request following this call.
        """
        if not user_db:
            raise ValueError('"user_db" is mandatory')

        mock_context = {
            "user": user_db,
            "auth_info": {"method": "authentication token", "location": "header"},
        }
        self.request_context_mock = mock.PropertyMock(return_value=mock_context)
        Router.mock_context = self.request_context_mock

        Select a user which is to be used by the HTTP request following this call.
        
st2tests/st2tests/api.py