Fix test hasattr