summaryrefslogtreecommitdiff
path: root/tests/forms_tests/widget_tests/test_select.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2019-10-21 09:55:05 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-29 12:37:30 +0100
commit7552de7866dcd270a0f353b007b4aceaa7f3ff3e (patch)
tree2e84292833853d9659671ed304cb32d5acef5f90 /tests/forms_tests/widget_tests/test_select.py
parenta6cb8ec3895a72bfb7f8e62d4b05dd5de6b738af (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/forms_tests/widget_tests/test_select.py')
-rw-r--r--tests/forms_tests/widget_tests/test_select.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/forms_tests/widget_tests/test_select.py b/tests/forms_tests/widget_tests/test_select.py
index fd4c1fb34c..935f6f6b5e 100644
--- a/tests/forms_tests/widget_tests/test_select.py
+++ b/tests/forms_tests/widget_tests/test_select.py
@@ -257,13 +257,13 @@ class SelectTest(WidgetTest):
self.assertEqual(options[0]['value'], 'J')
self.assertEqual(options[0]['label'], 'John')
self.assertEqual(options[0]['index'], '0')
- self.assertEqual(options[0]['selected'], True)
+ self.assertIs(options[0]['selected'], True)
# Template-related attributes
self.assertEqual(options[1]['name'], 'name')
self.assertEqual(options[1]['value'], 'P')
self.assertEqual(options[1]['label'], 'Paul')
self.assertEqual(options[1]['index'], '1')
- self.assertEqual(options[1]['selected'], False)
+ self.assertIs(options[1]['selected'], False)
def test_optgroups(self):
choices = [
@@ -336,7 +336,7 @@ class SelectTest(WidgetTest):
)
self.assertEqual(index, 1)
label, options, index = unknown
- self.assertEqual(label, None)
+ self.assertIsNone(label)
self.assertEqual(
options,
[{