[tests] add a __main__ handler
the relative import in test_rest_api.py needs to be modified to prevent a
ValueError: Attempted relative import in non-package
from cubicweb.cwconfig import CubicWebConfiguration
def includeme(config):
appid = config.registry.settings['cubicweb.instance']
cwconfig = CubicWebConfiguration.config_for(appid)
config.registry['cubicweb.config'] = cwconfig
config.registry['cubicweb.repository'] = repo = cwconfig.repository()
config.registry['cubicweb.registry'] = repo.vreg