joechastain
01/27/2023, 6:34 PMcgi.remote_user
populated in main.index
as I'm doing something like userId = cgi.remote_user
and then passing userID
into a function to retrieve data and then display it on the screen based on who is logged in. What is the best approach here?zackster
01/27/2023, 7:22 PMjoechastain
01/27/2023, 8:12 PMbockensm
01/27/2023, 8:58 PMgetUserID
that is an easy-to-mock method in a testing environment.bockensm
01/27/2023, 8:58 PMmain
handler, the method would return cgi.remove_user
, but in your tests, could you mock it to return something else?joechastain
01/28/2023, 2:12 AMexecute
handler\method function in integration tests or not. I'll have to play around with it some more. Thanks for the thought.
I know I can set values in the rc scope with getRequestContext().setValue( "name", "value" )
but struggling to figure out how to override values that are populated in the handler method itself by calls to service methods.