From 675ce4dd35702ce353006611ba30799c0c4b015f Mon Sep 17 00:00:00 2001 From: dbxnr Date: Fri, 8 May 2020 08:44:33 +0200 Subject: [PATCH] Refs #31157 -- Added tests for display_for_field() with empty JSONField. --- tests/admin_utils/tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index 463ba9556d4..0ce18be0946 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -176,6 +176,9 @@ class UtilsTests(SimpleTestCase): display_value = display_for_field(None, models.FloatField(), self.empty_value) self.assertEqual(display_value, self.empty_value) + display_value = display_for_field(None, models.JSONField(), self.empty_value) + self.assertEqual(display_value, self.empty_value) + def test_number_formats_display_for_field(self): display_value = display_for_field(12345.6789, models.FloatField(), self.empty_value) self.assertEqual(display_value, '12345.6789')