testnode: Use hasattr instead of unappropriate get method