Added display_for_value() tests for boolean values.
This commit is contained in:
parent
acc8dd4142
commit
ea10efebfa
|
@ -200,6 +200,17 @@ class UtilsTests(SimpleTestCase):
|
||||||
display_value = display_for_value([1, 2, 'buckle', 'my', 'shoe'], self.empty_value)
|
display_value = display_for_value([1, 2, 'buckle', 'my', 'shoe'], self.empty_value)
|
||||||
self.assertEqual(display_value, '1, 2, buckle, my, shoe')
|
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),
|
||||||
|
'<img src="/static/admin/img/icon-yes.svg" alt="True" />'
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
display_for_value(False, '', boolean=True),
|
||||||
|
'<img src="/static/admin/img/icon-no.svg" alt="False" />'
|
||||||
|
)
|
||||||
|
|
||||||
def test_label_for_field(self):
|
def test_label_for_field(self):
|
||||||
"""
|
"""
|
||||||
Tests for label_for_field
|
Tests for label_for_field
|
||||||
|
|
Loading…
Reference in New Issue