mirror of
https://github.com/django/django.git
synced 2024-11-30 07:06:18 +01:00
Advanced deprecations in django.test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4d94c0cb38
commit
87508fbbf3
@ -421,7 +421,7 @@ class Client(RequestFactory):
|
||||
# Provide a backwards-compatible (but pending deprecation) response.template
|
||||
def _get_template(self):
|
||||
warnings.warn("response.template is deprecated; use response.templates instead (which is always a list)",
|
||||
PendingDeprecationWarning, stacklevel=2)
|
||||
DeprecationWarning, stacklevel=2)
|
||||
if not self.templates:
|
||||
return None
|
||||
elif len(self.templates) == 1:
|
||||
|
@ -19,7 +19,7 @@ class DjangoTestRunner(unittest.TextTestRunner):
|
||||
import warnings
|
||||
warnings.warn(
|
||||
"DjangoTestRunner is deprecated; it's functionality is indistinguishable from TextTestRunner",
|
||||
PendingDeprecationWarning
|
||||
DeprecationWarning
|
||||
)
|
||||
super(DjangoTestRunner, self).__init__(*args, **kwargs)
|
||||
|
||||
@ -355,12 +355,3 @@ class DjangoTestSuiteRunner(object):
|
||||
self.teardown_databases(old_config)
|
||||
self.teardown_test_environment()
|
||||
return self.suite_result(suite, result)
|
||||
|
||||
def run_tests(test_labels, verbosity=1, interactive=True, failfast=False, extra_tests=None):
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'The run_tests() test runner has been deprecated in favor of DjangoTestSuiteRunner.',
|
||||
DeprecationWarning
|
||||
)
|
||||
test_runner = DjangoTestSuiteRunner(verbosity=verbosity, interactive=interactive, failfast=failfast)
|
||||
return test_runner.run_tests(test_labels, extra_tests=extra_tests)
|
||||
|
Loading…
Reference in New Issue
Block a user