authens/runtests.py

18 lines
501 B
Python
Raw Normal View History

2020-05-12 21:21:45 +02:00
# Source:
# https://docs.djangoproject.com/en/3.0/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
2020-07-18 18:08:43 +02:00
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
2020-05-12 21:21:45 +02:00
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
failures = test_runner.run_tests(sys.argv[1:])
sys.exit(bool(failures))