this is the same Voodoo  we do in base.py

Can't we have them in one place (maybe included in the gaiatest package)