summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authorPanagiotis H.M. Issaris <takis@issaris.com>2023-02-22 20:46:16 +0100
committerGitHub <noreply@github.com>2023-02-22 20:46:16 +0100
commitdcd974698301a38081c141ccba6dcafa5ed2c80e (patch)
tree6c387c7d2a72cabdae7e659c230bdcf7ed4792c3 /tests/template_tests
parentad18a0102cc2968914232814c6554763f15abbe3 (diff)
downloaddjango-dcd974698301a38081c141ccba6dcafa5ed2c80e.tar.gz
Fixed #34363 -- Fixed floatformat crash on zero with trailing zeros.
Regression in 08c5a787262c1ae57f6517d4574b54a5fcaad124. Follow up to 4b066bde692078b194709d517b27e55defae787c.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/filter_tests/test_floatformat.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/template_tests/filter_tests/test_floatformat.py b/tests/template_tests/filter_tests/test_floatformat.py
index 8f75c2b4ee..db17622309 100644
--- a/tests/template_tests/filter_tests/test_floatformat.py
+++ b/tests/template_tests/filter_tests/test_floatformat.py
@@ -113,6 +113,10 @@ class FunctionTests(SimpleTestCase):
)
self.assertEqual(floatformat("0.00", 0), "0")
self.assertEqual(floatformat(Decimal("0.00"), 0), "0")
+ self.assertEqual(floatformat("0.0000", 2), "0.00")
+ self.assertEqual(floatformat(Decimal("0.0000"), 2), "0.00")
+ self.assertEqual(floatformat("0.000000", 4), "0.0000")
+ self.assertEqual(floatformat(Decimal("0.000000"), 4), "0.0000")
def test_negative_zero_values(self):
tests = [