Fix script to run unit tests following changes from erp5.git

This script is copy/paste from erp5.git/product/ERP5Type/tests/backportUnittest.py. Then, I applied all changes from the same file to fix the issue.