... efault. See 持続的 (persistent) な接続 for details. Discovery of tests in any test module Django 1.6 ships with a new test runner that allows more flexibility in the location of tests. The previous runner ( django.test.simple.DjangoTestSuiteRunner ) fo ... und tests only in the models.py and tests.py modules of a Python package in INSTALLED_APPS . The new runner ( django.test.runner.DiscoverRunner ) uses the test discovery features built into unittest2 (the version of unittest in th ... was only an option for PostgreSQL, and it was disabled by default. This option is now ignored and can be removed. New test runner In order to maintain greater consistency with Python's unittest module, the new test runner ( django.test.runner.DiscoverR ... ... nd deprecated features in the 1.1 branch, see the Django 1.1 リリースノート . Backwards-incompatible changes in 1.1.2 Test runner exit status code The exit status code of the test runners ( tests/runtests.py and python manage.py test ) no longer repres ... failed tests, since a failure of 256 or more tests resulted in a wrong exit status code. The exit status code for the test runner is now 0 for success (no failing tests) and 1 for any number of test failures. If needed, the number of test failures can ... be found at the end of the test runner's output. Cookie encoding To fix bugs with cookies in Internet Explorer, Safari, and possibly other browsers, our encoding ... ... !/usr/bin/env python import os import sys import django from django.conf import settings from django.test.utils import get_runner if __name__ == "__main__" : os . environ [ "DJANGO_SETTINGS_MODULE" ] = "tests.test_settings" django . setup () TestRunner ... = get_runner ( settings ) test_runner = TestRunner () failures = test_runner . run_tests ([ "tests" ]) sys . exit ( bool ( failures )) ... に構築されたテストを通常のDjangoテストのように呼び出す方法に対応しています。 ./manage.py test を実行するとき、Django は TEST_RUNNER 設定を見て、何をするかを決定します。デフォルトでは、 TEST_RUNNER は 'django.test.runner.DiscoverRunner' を指します。このク ... ... em report documentation on controlling the creation order of test databases for details. GeoDjango The function-based TEST_RUNNER previously used to execute the GeoDjango test suite, django.contrib.gis.tests.run_gis_tests , was finally deprecated in fa ... vor of a class-based test runner, django.contrib.gis.tests.GeoDjangoTestSuiteRunner , added in this release. In addition, the GeoDjango test suite is now i ... ... py script used to run Django's own test suite now support a --failfast option. When specified, this option causes the test runner to exit after encountering a failure instead of continuing with the test run. In addition, the handling of Ctrl-C during a ... ting over __dict__ to obtain a list of fields, you must now be prepared to handle or filter out the _state attribute. Test runner exit status code The exit status code of the test runners ( tests/runtests.py and python manage.py test ) no longer repres ... iled tests, because a failure of 256 or more tests resulted in a wrong exit status code. The exit status code for the test runner is now 0 for success (no failing tests) and 1 for any number of test failures. If needed, the number of test failures can ... ... the cycle template tag. You can now specify specific directories for a particular filesystem.Loader . テスト Added DiscoverRunner.get_test_runner_kwargs() to allow customizing the keyword arguments passed to the test runner. Added the test --debug-mode ... t test failures by setting the DEBUG setting to True . The new django.test.utils.setup_databases() (moved from django.test.runner ) and teardown_databases() functions make it easier to build custom test runners. Added support for unittest.TestCase.subT ... est() 's when using the test --parallel option. DiscoverRunner now runs the system checks at the start of a test run. Override the DiscoverRunner.run_checks() method if you want to disa ... ... ンテキストの外で構築されたサイトマップのデフォルトのサイトマッププロトコルは、 'http' から 'https' に変更されます。 DiscoverRunner.build_suite() および DiscoverRunner.run_tests() での extra_tests 引数は削除されます。 django.contrib.postgres.aggregates.A ... lete() will be removed. The extra_context parameter of contrib.auth.views.logout_then_login() will be removed. django.test.runner.setup_databases() will be removed. django.utils.translation.string_concat() will be removed. django.core.cache.backends.me ... r of django.forms.widgets.RadioChoiceInput . The module django.test.simple and the class django.test.simple.DjangoTestSuiteRunner will be removed. Instead use django.test.runner.DiscoverRunner . The module django.test._doctest will be removed. Instead ... ... ts() method as described in カスタム django-admin コマンドの作り方 . Custom test management command arguments through test runner The method to add custom arguments to the test management command through the test runner has changed. Previously, you cou ... ld provide an option_list class variable on the test runner to add more arguments (à la optparse ). Now to implement the same behavior, you have to create an add_arguments(cls, parse ... r) class method on the test runner and call parser.add_argument to add any custom arguments, as parser is now an argparse.ArgumentParser instance. Model chec ... ... favor of a new templates attribute, which is always a list, even if it has only a single element or no elements. DjangoTestRunner As a result of the introduction of support for unittest2 , the features of django.test.simple.DjangoTestRunner (including ... fail-fast and Ctrl-C test termination) have been made redundant. In view of this redundancy, DjangoTestRunner has been turned into an empty placeholder class, and will be removed entirely in Django 1.5. Changes to url and ssi ほとん ... ed to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually. GeoDjango The function-based TEST_RUNNER previously used to execute the GeoDjango test suite, django.contrib.gis.tests.run_gis_tests , was deprecated for the class ... ... eset_complete() are removed. The extra_context parameter of contrib.auth.views.logout_then_login() is removed. django.test.runner.setup_databases() is removed. django.utils.translation.string_concat() is removed. django.core.cache.backends.memcached.Py ... 2026年10月08日