1
0
mirror of https://github.com/django/django.git synced 2024-12-24 18:16:19 +00: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:
Russell Keith-Magee 2011-04-02 08:41:26 +00:00
parent 4d94c0cb38
commit 87508fbbf3
2 changed files with 2 additions and 11 deletions

View File

@ -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:

View File

@ -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)