PY-17265 Add missing test on handling imports for moved local function