def main():
    show_settings(settings, "benchmarks")
    glob = [USERS_COUNT, OBJECTS_COUNT, OBJECTS_WIHT_PERMS_COUNT]
    Benchmark("Direct relations benchmark with subqueries", *glob, model=TestDirectModel, subquery=True).main()

    Benchmark("Direct relations benchmark without subqueries", *glob, model=TestDirectModel, subquery=False).main()

    Benchmark("Generic relations benchmark without subqueries", *glob, model=TestModel, subquery=False).main()
def main():
    show_settings(settings, 'benchmarks')
    benchmark = Benchmark('Direct relations benchmark',
        USERS_COUNT, OBJECTS_COUNT, OBJECTS_WIHT_PERMS_COUNT, TestDirectModel)
    benchmark.main()

    benchmark = Benchmark('Generic relations benchmark',
        USERS_COUNT, OBJECTS_COUNT, OBJECTS_WIHT_PERMS_COUNT, TestModel)
    benchmark.main()
Example #3
0
def run_tests(settings):
    from django.test.utils import get_runner
    from utils import show_settings

    show_settings(settings, 'tests')

    TestRunner = get_runner(settings)
    test_runner = TestRunner(interactive=False)
    failures = test_runner.run_tests(['auth', 'guardian'])
    return failures
Example #4
0
def run_tests(settings):
    from django.test.utils import get_runner
    from utils import show_settings

    show_settings(settings, "tests")

    TestRunner = get_runner(settings)
    test_runner = TestRunner(interactive=False)
    failures = test_runner.run_tests(["auth", "guardian"])
    return failures
Example #5
0
def run_tests(settings):
    from django.test.utils import get_runner
    from utils import show_settings

    show_settings(settings, 'tests')

    import django
    if hasattr(django, 'setup'):
        django.setup()

    TestRunner = get_runner(settings)
    test_runner = TestRunner(interactive=False)
    failures = test_runner.run_tests(['auth', 'guardian', 'testapp'])
    return failures
Example #6
0
def run_tests(settings):
    from django.test.utils import get_runner
    from utils import show_settings

    show_settings(settings, 'tests')

    import django
    if hasattr(django, 'setup'):
        django.setup()

    TestRunner = get_runner(settings)
    test_runner = TestRunner(interactive=False)
    # As we use different TestRunners for django < 1.8 and >= 1.8
    # the arguments run_tests differs
    if django.VERSION < (1, 7):
        failures = test_runner.run_tests(['auth', 'guardian', 'testapp'])
    else:
        failures = test_runner.run_tests(['guardian'])
    return failures