Add call to generate-fixtures in test-backend.

Add call to tools/generate-fixtures in tools/test-backend before
starting the tests.  Previously, test-backend could fail if called
after tools/test-js-with-casper had failed.

Fixes #501.
This commit is contained in:
Eklavya Sharma 2016-03-12 10:28:35 +05:30 committed by Tim Abbott
parent 01bfa2d94d
commit 3ab567db98
1 changed files with 5 additions and 1 deletions

View File

@ -4,13 +4,15 @@ from __future__ import print_function
import optparse import optparse
import os import os
import sys import sys
import subprocess
import django import django
from django.conf import settings from django.conf import settings
from django.test.utils import get_runner from django.test.utils import get_runner
if __name__ == "__main__": if __name__ == "__main__":
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(TOOLS_DIR))
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess # "-u" uses unbuffered IO, which is important when wrapping it in subprocess
os.environ['PYTHONUNBUFFERED'] = 'y' os.environ['PYTHONUNBUFFERED'] = 'y'
@ -41,6 +43,8 @@ if __name__ == "__main__":
prof = cProfile.Profile() prof = cProfile.Profile()
prof.enable() prof.enable()
subprocess.call(os.path.join(TOOLS_DIR, 'generate-fixtures'))
TestRunner = get_runner(settings) TestRunner = get_runner(settings)
test_runner = TestRunner() test_runner = TestRunner()
failures = test_runner.run_tests(suites, fatal_errors=options.fatal_errors) failures = test_runner.run_tests(suites, fatal_errors=options.fatal_errors)