2014-02-13 12:44:49 +00:00
|
|
|
#!/usr/bin/env python
|
2014-02-17 11:03:41 +00:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import shutil
|
2014-07-23 13:48:42 +00:00
|
|
|
import warnings
|
2014-02-13 12:44:49 +00:00
|
|
|
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
|
2014-06-30 14:08:09 +00:00
|
|
|
from wagtail.tests.settings import STATIC_ROOT, MEDIA_ROOT
|
2014-02-13 12:44:49 +00:00
|
|
|
|
2014-02-14 17:17:31 +00:00
|
|
|
|
2014-06-30 14:08:09 +00:00
|
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'wagtail.tests.settings'
|
2014-02-13 12:44:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
def runtests():
|
2014-07-23 13:48:42 +00:00
|
|
|
# Don't ignore DeprecationWarnings
|
|
|
|
warnings.simplefilter('default', DeprecationWarning)
|
|
|
|
|
2014-02-13 12:44:49 +00:00
|
|
|
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
|
2014-02-13 12:53:52 +00:00
|
|
|
try:
|
|
|
|
execute_from_command_line(argv)
|
|
|
|
finally:
|
|
|
|
shutil.rmtree(STATIC_ROOT, ignore_errors=True)
|
2014-02-23 14:57:33 +00:00
|
|
|
shutil.rmtree(MEDIA_ROOT, ignore_errors=True)
|
2014-02-13 12:44:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
runtests()
|