diff options
| author | Nick Pope <nick.pope@flightdataservices.com> | 2019-10-21 09:55:05 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-29 12:37:30 +0100 |
| commit | 7552de7866dcd270a0f353b007b4aceaa7f3ff3e (patch) | |
| tree | 2e84292833853d9659671ed304cb32d5acef5f90 /tests/one_to_one | |
| parent | a6cb8ec3895a72bfb7f8e62d4b05dd5de6b738af (diff) | |
Used more specific unittest assertions in tests.
* assertIsNone()/assertIsNotNone() instead of comparing to None.
* assertLess() for < comparisons.
* assertIs() for 'is' expressions.
* assertIsInstance() for isinstance() expressions.
* rounding of assertAlmostEqual() for round() expressions.
* assertIs(..., True/False) instead of comparing to True/False.
* assertIs()/assertIsNot() for ==/!= comparisons.
* assertNotEqual() for == comparisons.
* assertTrue()/assertFalse() instead of comparing to True/False.
Diffstat (limited to 'tests/one_to_one')
| -rw-r--r-- | tests/one_to_one/tests.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/one_to_one/tests.py b/tests/one_to_one/tests.py index 1215cf8001..1c48d500ec 100644 --- a/tests/one_to_one/tests.py +++ b/tests/one_to_one/tests.py @@ -271,7 +271,7 @@ class OneToOneTests(TestCase): # Creation using keyword argument and unsaved related instance (#8070). p = Place() r = Restaurant(place=p) - self.assertTrue(r.place is p) + self.assertIs(r.place, p) # Creation using attname keyword argument and an id will cause the related # object to be fetched. |
