diff options
| author | Tim Graham <timograham@gmail.com> | 2015-05-09 19:13:05 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-16 10:42:12 -0400 |
| commit | c2bc1cefdcbbf074408f4a4cace88b315cf9d652 (patch) | |
| tree | 0fe2d590415c4e2e7fc53ec49cc08a7ed6396aff | |
| parent | 70e3e2e08ee1d07343d48b1db9df838db3efb0e2 (diff) | |
Refs #23763 -- Silenced SimpleTestCase.assertRaisesMessage() deprecation warning on Python 3.5.
Deprecation warning was introduced in https://bugs.python.org/issue24134
| -rw-r--r-- | django/test/testcases.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index cff2f4411e..86a275e7fd 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -578,8 +578,7 @@ class SimpleTestCase(unittest.TestCase): msg_prefix + "Template '%s' was used unexpectedly in rendering" " the response" % template_name) - def assertRaisesMessage(self, expected_exception, expected_message, - callable_obj=None, *args, **kwargs): + def assertRaisesMessage(self, expected_exception, expected_message, *args, **kwargs): """ Asserts that the message in a raised exception matches the passed value. @@ -587,12 +586,11 @@ class SimpleTestCase(unittest.TestCase): Args: expected_exception: Exception class expected to be raised. expected_message: expected error message string value. - callable_obj: Function to be called. - args: Extra args. + args: Function to be called and extra positional args. kwargs: Extra kwargs. """ return six.assertRaisesRegex(self, expected_exception, - re.escape(expected_message), callable_obj, *args, **kwargs) + re.escape(expected_message), *args, **kwargs) def assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value=''): |
