summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Wobrock <david.wobrock@gmail.com>2023-01-18 22:54:17 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-19 10:15:40 +0100
commit4b066bde692078b194709d517b27e55defae787c (patch)
tree26707859ff3c0ea298230083553832db9001dda9 /tests
parent39f83765e12b0e5d260b7939fc3fe281d879b279 (diff)
Fixed #34272 -- Fixed floatformat crash on zero with trailing zeros to zero decimal places.
Regression in 08c5a787262c1ae57f6517d4574b54a5fcaad124. Thanks Andrii Lahuta for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/filter_tests/test_floatformat.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/template_tests/filter_tests/test_floatformat.py b/tests/template_tests/filter_tests/test_floatformat.py
index 361a888ce3..8f75c2b4ee 100644
--- a/tests/template_tests/filter_tests/test_floatformat.py
+++ b/tests/template_tests/filter_tests/test_floatformat.py
@@ -111,6 +111,8 @@ class FunctionTests(SimpleTestCase):
self.assertEqual(
floatformat(0.000000000000000000015, 20), "0.00000000000000000002"
)
+ self.assertEqual(floatformat("0.00", 0), "0")
+ self.assertEqual(floatformat(Decimal("0.00"), 0), "0")
def test_negative_zero_values(self):
tests = [