summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVlastimil Zíma <ziima@users.noreply.github.com>2022-10-24 12:59:34 +0200
committerGitHub <noreply@github.com>2022-10-24 12:59:34 +0200
commit08c5a787262c1ae57f6517d4574b54a5fcaad124 (patch)
tree32d549f830ff111954373312d4bdef8835b8e677 /tests
parent1d6948096f6fe7aa887d651e01e9af8e4ef349a2 (diff)
Fixed #34098 -- Fixed loss of precision for Decimal values in floatformat filter.
Regression in 12f7928f5a455e330c0a7f19bc86b37baca12811.
Diffstat (limited to '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 8dc69b2437..361a888ce3 100644
--- a/tests/template_tests/filter_tests/test_floatformat.py
+++ b/tests/template_tests/filter_tests/test_floatformat.py
@@ -56,6 +56,10 @@ class FunctionTests(SimpleTestCase):
self.assertEqual(floatformat(0.12345, 2), "0.12")
self.assertEqual(floatformat(Decimal("555.555"), 2), "555.56")
self.assertEqual(floatformat(Decimal("09.000")), "9")
+ self.assertEqual(
+ floatformat(Decimal("123456.123456789012345678901"), 21),
+ "123456.123456789012345678901",
+ )
self.assertEqual(floatformat("foo"), "")
self.assertEqual(floatformat(13.1031, "bar"), "13.1031")
self.assertEqual(floatformat(18.125, 2), "18.13")