summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authormendespedro <windowsxpedro@gmail.com>2021-12-15 13:56:04 -0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-12-20 06:46:34 +0100
commit4fd3044ca0135da903a70dfb66992293f529ecf1 (patch)
tree5884d724f07c6d3c39d9477cec8093796a239f1c /tests/utils_tests
parentb0d16d0129b7cc5978a8d55d2331a34cb369e6c7 (diff)
downloaddjango-4fd3044ca0135da903a70dfb66992293f529ecf1.tar.gz
Fixed #33368 -- Fixed parse_duration() crash on invalid separators for decimal fractions.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_dateparse.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/utils_tests/test_dateparse.py b/tests/utils_tests/test_dateparse.py
index 0880de2034..f2f66f351d 100644
--- a/tests/utils_tests/test_dateparse.py
+++ b/tests/utils_tests/test_dateparse.py
@@ -161,6 +161,11 @@ class DurationParseTests(unittest.TestCase):
('-PT0.000005S', timedelta(microseconds=-5)),
('-PT0,000005S', timedelta(microseconds=-5)),
('-P4DT1H', timedelta(days=-4, hours=-1)),
+ # Invalid separators for decimal fractions.
+ ('P3(3D', None),
+ ('PT3)3H', None),
+ ('PT3|3M', None),
+ ('PT3/3S', None),
)
for source, expected in test_values:
with self.subTest(source=source):