mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-18 23:20:28 +00:00
Added testrunner that works with django
This commit is contained in:
parent
3b7f4d7fe8
commit
cc3b60f8c2
2 changed files with 19 additions and 0 deletions
0
example/__init__.py
Normal file
0
example/__init__.py
Normal file
19
runtests.py
Executable file
19
runtests.py
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
|
||||
exampleproject_dir = os.path.join(os.path.dirname(__file__), 'example')
|
||||
sys.path.insert(0, exampleproject_dir)
|
||||
|
||||
from django.test.utils import get_runner
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def runtests():
|
||||
TestRunner = get_runner(settings)
|
||||
test_runner = TestRunner(verbosity=1, interactive=True)
|
||||
failures = test_runner.run_tests(['blog', 'djadmin2'])
|
||||
sys.exit(bool(failures))
|
||||
|
||||
if __name__ == '__main__':
|
||||
runtests()
|
||||
Loading…
Reference in a new issue