wagtail-birdsong/runtests.py

18 lines
481 B
Python
Raw Normal View History

2020-05-29 01:56:25 +00:00
import os
import shutil
import sys
def run():
from django.core.management import execute_from_command_line
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.app.settings'
try:
execute_from_command_line([sys.argv[0], 'test'] + sys.argv[1:])
finally:
from tests.app.settings import STATIC_ROOT, MEDIA_ROOT
shutil.rmtree(STATIC_ROOT, ignore_errors=True)
shutil.rmtree(MEDIA_ROOT, ignore_errors=True)
if __name__ == '__main__':
run()