From ea10efebfaa15fd7a9dcdd01c6d044ded0a8306a Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Wed, 3 Jan 2018 14:48:41 -0500 Subject: [PATCH] Added display_for_value() tests for boolean values. --- tests/admin_utils/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index 1f475c2f5b..212254f4fd 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -200,6 +200,17 @@ class UtilsTests(SimpleTestCase): display_value = display_for_value([1, 2, 'buckle', 'my', 'shoe'], self.empty_value) self.assertEqual(display_value, '1, 2, buckle, my, shoe') + @override_settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=True) + def test_list_display_for_value_boolean(self): + self.assertEqual( + display_for_value(True, '', boolean=True), + 'True' + ) + self.assertEqual( + display_for_value(False, '', boolean=True), + 'False' + ) + def test_label_for_field(self): """ Tests for label_for_field