8ef3ab9980fd35bc5d1af3a19a61f76ccc164201
[django-pagination.git] / linaro_django_pagination / tests / runner.py
1 #!/usr/bin/env python
2
3 import django
4 import os
5 import sys
6
7 from django.core.management import call_command
8
9
10 def runtests():
11     os.environ['DJANGO_SETTINGS_MODULE'] = 'linaro_django_pagination.tests.settings'
12
13     try:
14         django.setup()
15     except AttributeError:  # for Django 1.6 compatible
16         pass
17
18     failures = call_command('test', 'linaro_django_pagination')
19     sys.exit(bool(failures))
20
21 if __name__ == '__main__':
22     runtests()