1
0
mirror of https://github.com/django/django.git synced 2025-07-17 16:19:12 +00:00

[3.0.x] Added guidelines for assertIs() usage.

Backport of ea44d86ed43349db25b6b2d8e4d4af2d5c618cf9 from master
This commit is contained in:
Mads Jensen 2019-12-22 11:23:46 +01:00 committed by Mariusz Felisiak
parent a04e6fb355
commit 222b56474d

View File

@ -71,6 +71,11 @@ Python style
and :meth:`~unittest.TestCase.assertWarnsRegex` only if you need regular
expression matching.
Use :meth:`assertIs(…, True/False)<unittest.TestCase.assertIs>` for testing
boolean values, rather than :meth:`~unittest.TestCase.assertTrue` and
:meth:`~unittest.TestCase.assertFalse`, so you can check the actual boolean
value, not the truthiness of the expression.
* In test docstrings, state the expected behavior that each test demonstrates.
Don't include preambles such as "Tests that" or "Ensures that".