`
+
November 1, 2023 - :cve:`2023-46695`
------------------------------------
diff --git a/tests/humanize_tests/tests.py b/tests/humanize_tests/tests.py
index 3c227873cf2c..d6d7ea02ad47 100644
--- a/tests/humanize_tests/tests.py
+++ b/tests/humanize_tests/tests.py
@@ -80,12 +80,18 @@ def test_intcomma(self):
-1234567.25,
"100",
"-100",
+ "100.1",
+ "-100.1",
+ "100.13",
+ "-100.13",
"1000",
"-1000",
"10123",
"-10123",
"10311",
"-10311",
+ "100000.13",
+ "-100000.13",
"1000000",
"-1000000",
"1234567.1234567",
@@ -114,12 +120,18 @@ def test_intcomma(self):
"-1,234,567.25",
"100",
"-100",
+ "100.1",
+ "-100.1",
+ "100.13",
+ "-100.13",
"1,000",
"-1,000",
"10,123",
"-10,123",
"10,311",
"-10,311",
+ "100,000.13",
+ "-100,000.13",
"1,000,000",
"-1,000,000",
"1,234,567.1234567",
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index 0a6f0bc3f260..758919c66e81 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -159,6 +159,32 @@ def test_truncate_html_words(self):
truncator = text.Truncator('I <3 python, what about you?
')
self.assertEqual('I <3 python,…
', truncator.words(3, html=True))
+ # Only open brackets.
+ test = "<" * 60_000
+ truncator = text.Truncator(test)
+ self.assertEqual(truncator.words(1, html=True), test)
+
+ # Tags with special chars in attrs.
+ truncator = text.Truncator(
+ """Hello, my dear lady!"""
+ )
+ self.assertEqual(
+ """Hello, my dear…""",
+ truncator.words(3, html=True),
+ )
+
+ # Tags with special non-latin chars in attrs.
+ truncator = text.Truncator("""Hello, my dear lady!
""")
+ self.assertEqual(
+ """Hello, my dear…
""",
+ truncator.words(3, html=True),
+ )
+
+ # Misplaced brackets.
+ truncator = text.Truncator("hello >< world")
+ self.assertEqual(truncator.words(1, html=True), "hello…")
+ self.assertEqual(truncator.words(2, html=True), "hello >< world")
+
@patch("django.utils.text.Truncator.MAX_LENGTH_HTML", 10_000)
def test_truncate_words_html_size_limit(self):
max_len = text.Truncator.MAX_LENGTH_HTML