From be0620b49fce5ddd179356575603c4160390965e Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 21 Nov 2025 17:55:28 +0100 Subject: [PATCH 1/2] Refs #36031 -- Added tests of DecimalRangeField __contains lookup with unbounded decimal ranges. Co-authored-by: Aman Sharma <210100011@iitb.ac.in> --- tests/postgres_tests/test_ranges.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/postgres_tests/test_ranges.py b/tests/postgres_tests/test_ranges.py index 859eb0da79b..f1c104e83bc 100644 --- a/tests/postgres_tests/test_ranges.py +++ b/tests/postgres_tests/test_ranges.py @@ -304,6 +304,25 @@ def test_contains_range(self): [self.objs[0]], ) + def test_decimal_contains_range(self): + decimals = RangesModel.objects.bulk_create( + [ + RangesModel(decimals=NumericRange(None, 10)), + RangesModel(decimals=NumericRange(10, None)), + RangesModel(decimals=NumericRange(5, 15)), + RangesModel(decimals=NumericRange(5, 15, "(]")), + ] + ) + for contains, objs in [ + (199, [decimals[1]]), + (1, [decimals[0]]), + (15, [decimals[1], decimals[3]]), + ]: + with self.subTest(decimal_contains=contains): + self.assertSequenceEqual( + RangesModel.objects.filter(decimals__contains=contains), objs + ) + def test_contained_by(self): self.assertSequenceEqual( RangesModel.objects.filter(ints__contained_by=NumericRange(0, 20)), From 3f15935420c0f45760804b807a78a26f4ffe28e4 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 21 Nov 2025 10:28:59 -0500 Subject: [PATCH 2/2] Refs #36705 -- Added coverage for multiple types of enclosing punctuation in urlize(). This case was inadvertently fixed in ad94446fcc5b50401dd0c48718502d5d1b92df58. --- tests/template_tests/filter_tests/test_urlize.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/template_tests/filter_tests/test_urlize.py b/tests/template_tests/filter_tests/test_urlize.py index 692c3fc8306..c8c403ba958 100644 --- a/tests/template_tests/filter_tests/test_urlize.py +++ b/tests/template_tests/filter_tests/test_urlize.py @@ -218,6 +218,13 @@ def test_parenthesis(self): 'rel="nofollow">https://en.wikipedia.org/wiki/Django_(web_framework))', ) + def test_parenthesis_and_bracket(self): + self.assertEqual( + urlize("[(https://en.wikipedia.org/)]"), + '[(https://en.wikipedia.org/)]', + ) + def test_nofollow(self): """ #12183 - Check urlize adds nofollow properly - see #12183