

def django_tests(verbosity, interactive, failfast, test_labels):
    from django.conf import settings
    state = setup(verbosity, test_labels)
    extra_tests = []
    if (geodjango(settings) and ((not test_labels) or ('gis' in test_labels))):
        from django.contrib.gis.tests import geodjango_suite
        extra_tests.append(geodjango_suite(apps=False))
    from django.test.utils import get_runner
    if (not hasattr(settings, 'TEST_RUNNER')):
        settings.TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
    TestRunner = get_runner(settings)
    test_runner = TestRunner(verbosity=verbosity, interactive=interactive, failfast=failfast)
    failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
    teardown(state)
    return failures

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/tests/runtests.py django_tests/original