Issue #3131819 by jungle, mondrake, xjm, dww: Replace assertions involving calls to is_resource() with assertIsResource() (cherry picked from commit 809cfa14)