How to mock ic_cdk::caller() ? when using dfx command line to test functions?

such as:

#[update(guard = "user_owner_guard")]
fn delete_wallet(wallet_addr: String) -> Result<bool, String> {
    CONTEXT.with(|c| {
        let mut ctx = c.borrow_mut();
        let user = ctx.env.caller();
            .delete_wallet(&user, wallet_addr)

I tried this :slight_smile:

dfx canister  call backend  delete_wallet  "b76rz-axcfs-swjig-bzzpx-yt5g7-2vcpg-wmb7i-2mz7s-upd4f-mag4c-yae"

but not work .

  The replica returned a replica error: Replica Error: reject code CanisterReject, reject message caller is not owner, error code None

which is a command need the ic_cdk::caller() function.
I have read the offical doc . but didnt find out solution.

have a look at the options of dfx identity: dfx identity --help. You can create a few different ones to test with