From 7552de7866dcd270a0f353b007b4aceaa7f3ff3e Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Mon, 21 Oct 2019 09:55:05 +0100 Subject: 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. --- tests/model_fields/test_imagefield.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/model_fields') diff --git a/tests/model_fields/test_imagefield.py b/tests/model_fields/test_imagefield.py index 8fb64be464..59a1836bdb 100644 --- a/tests/model_fields/test_imagefield.py +++ b/tests/model_fields/test_imagefield.py @@ -269,7 +269,7 @@ class ImageFieldTwoDimensionsTests(ImageFieldTestMixin, TestCase): # Field and dimensions should be cleared after a delete. p.mugshot.delete(save=False) - self.assertEqual(p.mugshot, None) + self.assertIsNone(p.mugshot.name) self.check_dimensions(p, None, None) def test_dimensions(self): -- cgit v1.3