mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().
This commit is contained in:
parent
7ba040de77
commit
704443acac
21 changed files with 210 additions and 285 deletions
|
@ -62,10 +62,14 @@ Python style
|
|||
|
||||
* In docstrings, follow the style of existing docstrings and :pep:`257`.
|
||||
|
||||
* In tests, use :meth:`~django.test.SimpleTestCase.assertRaisesMessage` instead
|
||||
of :meth:`~unittest.TestCase.assertRaises` so you can check the exception
|
||||
message. Use :meth:`~unittest.TestCase.assertRaisesRegex` only if you need
|
||||
regular expression matching.
|
||||
* In tests, use
|
||||
:meth:`~django.test.SimpleTestCase.assertRaisesMessage` and
|
||||
:meth:`~django.test.SimpleTestCase.assertWarnsMessage`
|
||||
instead of :meth:`~unittest.TestCase.assertRaises` and
|
||||
:meth:`~unittest.TestCase.assertWarns` so you can check the
|
||||
exception or warning message. Use :meth:`~unittest.TestCase.assertRaisesRegex`
|
||||
and :meth:`~unittest.TestCase.assertWarnsRegex` only if you need regular
|
||||
expression matching.
|
||||
|
||||
* In test docstrings, state the expected behavior that each test demonstrates.
|
||||
Don't include preambles such as "Tests that" or "Ensures that".
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue