def setup():
    global test_runner
    global old_config

    try:
        from django.test.runner import DiscoverRunner
        test_runner = DiscoverRunner()
    except __HOLE__:
        # Django 1.5 did not have the DiscoverRunner
        from django.test.simple import DjangoTestSuiteRunner
        test_runner = DjangoTestSuiteRunner()

    test_runner.setup_test_environment()
    old_config = test_runner.setup_databases()
dataset/ETHPy150Open inonit/drf-haystack/tests/__init__.py/setup