-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmanage.py
More file actions
executable file
·28 lines (24 loc) · 826 Bytes
/
Copy pathmanage.py
File metadata and controls
executable file
·28 lines (24 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
try:
command = sys.argv[1]
except IndexError:
command = None
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
if command == "testsuite":
import django
from django.conf import settings
from django.test.utils import get_runner
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=2)
failures = test_runner.run_tests(["tests"])
sys.exit(bool(failures))
else:
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError("Error importing django, is it installed?") from exc
execute_from_command_line(sys.argv)