diff options
| author | Morgan Aubert <morgan.aubert@impakfinance.com> | 2018-04-27 17:18:15 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-05-09 11:40:28 -0400 |
| commit | 704443acacf0dfbcb1c52df4b260585055754ce7 (patch) | |
| tree | 600147bf6114d7b490fcd253ff9797b7e7531c09 /docs/internals | |
| parent | 7ba040de7703fd06b9b35ddd31da40103d911c30 (diff) | |
Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().
Diffstat (limited to 'docs/internals')
| -rw-r--r-- | docs/internals/contributing/writing-code/coding-style.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index 5721c969cf..b34be61bc4 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -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". |
