From 3ab567db985d063e1e85c8957c57b235bfb94d25 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Sat, 12 Mar 2016 10:28:35 +0530 Subject: [PATCH] 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. --- tools/test-backend | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/test-backend b/tools/test-backend index ef04b2e70a..1676cd6b8b 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -4,13 +4,15 @@ from __future__ import print_function import optparse import os import sys +import subprocess import django from django.conf import settings from django.test.utils import get_runner 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' # "-u" uses unbuffered IO, which is important when wrapping it in subprocess os.environ['PYTHONUNBUFFERED'] = 'y' @@ -41,6 +43,8 @@ if __name__ == "__main__": prof = cProfile.Profile() prof.enable() + subprocess.call(os.path.join(TOOLS_DIR, 'generate-fixtures')) + TestRunner = get_runner(settings) test_runner = TestRunner() failures = test_runner.run_tests(suites, fatal_errors=options.fatal_errors)