diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/runtests.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index 7d1ee1e29c..7b52445d84 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -73,7 +73,7 @@ class InvalidModelTestCase(unittest.TestCase): self.assert_(not unexpected, "Unexpected Errors: " + '\n'.join(unexpected)) self.assert_(not missing, "Missing Errors: " + '\n'.join(missing)) -def django_tests(verbosity, tests_to_run): +def django_tests(verbosity, interactive, tests_to_run): from django.conf import settings old_installed_apps = settings.INSTALLED_APPS @@ -130,7 +130,7 @@ def django_tests(verbosity, tests_to_run): # Run the test suite, including the extra validation tests. from django.test.simple import run_tests - failures = run_tests(test_models, verbosity, extra_tests=extra_tests) + failures = run_tests(test_models, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests) if failures: sys.exit(failures) @@ -149,6 +149,8 @@ if __name__ == "__main__": parser.add_option('-v','--verbosity', action='store', dest='verbosity', default='0', type='choice', choices=['0', '1', '2'], help='Verbosity level; 0=minimal output, 1=normal output, 2=all output') + parser.add_option('--noinput', action='store_false', dest='interactive', default=True, + help='Tells Django to NOT prompt the user for input of any kind.') parser.add_option('--settings', help='Python path to settings module, e.g. "myproject.settings". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') options, args = parser.parse_args() @@ -157,4 +159,4 @@ if __name__ == "__main__": elif "DJANGO_SETTINGS_MODULE" not in os.environ: parser.error("DJANGO_SETTINGS_MODULE is not set in the environment. " "Set it or use --settings.") - django_tests(int(options.verbosity), args) + django_tests(int(options.verbosity), options.interactive, args) |
