mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().
This commit is contained in:
committed by
Tim Graham
parent
7ba040de77
commit
704443acac
@@ -692,6 +692,8 @@ A subclass of :class:`unittest.TestCase` that adds this functionality:
|
||||
|
||||
* Checking that a callable :meth:`raises a certain exception
|
||||
<SimpleTestCase.assertRaisesMessage>`.
|
||||
* Checking that a callable :meth:`triggers a certain warning
|
||||
<SimpleTestCase.assertWarnsMessage>`.
|
||||
* Testing form field :meth:`rendering and error treatment
|
||||
<SimpleTestCase.assertFieldOutput>`.
|
||||
* Testing :meth:`HTML responses for the presence/lack of a given fragment
|
||||
@@ -1362,6 +1364,15 @@ your test suite.
|
||||
with self.assertRaisesMessage(ValueError, 'invalid literal for int()'):
|
||||
int('a')
|
||||
|
||||
.. method:: SimpleTestCase.assertWarnsMessage(expected_warning, expected_message, callable, *args, **kwargs)
|
||||
SimpleTestCase.assertWarnsMessage(expected_warning, expected_message)
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
Analogous to :meth:`SimpleTestCase.assertRaisesMessage` but for
|
||||
:meth:`~unittest.TestCase.assertWarnsRegex` instead of
|
||||
:meth:`~unittest.TestCase.assertRaisesRegex`.
|
||||
|
||||
.. method:: SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
|
||||
|
||||
Asserts that a form field behaves correctly with various inputs.
|
||||
|
||||
Reference in New Issue
Block a user