1#!/usr/bin/env python
2
3
4import sys
5
6from django import setup
7from django.conf import settings
8from django.test.runner import DiscoverRunner as TestRunner
9
10from dpaste.settings import tests as test_settings
11
12
13def runtests(*test_args):
14    # Setup settings
15    if not settings.configured:
16        settings.configure(**test_settings.__dict__)
17    setup()
18    test_runner = TestRunner(verbosity=1)
19    failures = test_runner.run_tests(['dpaste'])
20    if failures:
21        sys.exit(failures)
22
23if __name__ == '__main__':
24    runtests(*sys.argv[1:])
25