From 3a15d1b34d7d52616c9e217fab2192b1e93aa881 Mon Sep 17 00:00:00 2001 From: Mike Edmunds Date: Mon, 6 Jul 2026 11:13:17 -0700 Subject: [PATCH 1/2] Fixed flatpages synopsis in docs. Changed `?flat?` to `"flat"` in synopsis. (Guessing this was an encoding problem related to fancy quotes in some earlier version.) Removed `simple` from synopsis, matching other page content. --- docs/ref/contrib/flatpages.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt index 33d789be4173..8c816bebd122 100644 --- a/docs/ref/contrib/flatpages.txt +++ b/docs/ref/contrib/flatpages.txt @@ -3,8 +3,7 @@ The flatpages app ================= .. module:: django.contrib.flatpages - :synopsis: A framework for managing simple ?flat? HTML content in a - database. + :synopsis: A framework for managing "flat" HTML content in a database. Django comes with an optional "flatpages" application. It lets you store "flat" HTML content in a database and handles the management for you via Django's From 7f3954386beaabc59695629b81c2c2d0cf0fe522 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 26 Jun 2026 14:12:36 -0400 Subject: [PATCH 2/2] Added tests for StringAgg edge cases. Additional coverage for MongoDB's implementation of StringAgg. --- tests/aggregation/tests.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index eda328621714..f6b676ade414 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -593,6 +593,21 @@ def test_distinct_on_stringagg_sqlite_special_case(self): ) self.assertCountEqual(books["ratings"].split(","), ["3.0", "4.0", "4.5", "5.0"]) + @skipUnlessDBFeature( + "supports_aggregate_distinct_multiple_argument", + "supports_aggregate_order_by_clause", + ) + def test_string_agg_distinct_with_order_by(self): + books = Book.objects.aggregate( + ratings=StringAgg( + Cast(F("rating"), CharField()), + Value(","), + distinct=True, + order_by=Cast(F("rating"), CharField()), + ) + ) + self.assertEqual(books["ratings"], "3,4,4.5,5") + @skipIfDBFeature("supports_aggregate_distinct_multiple_argument") def test_raises_error_on_multiple_argument_distinct(self): message = ( @@ -2497,6 +2512,18 @@ def test_string_agg_escapes_delimiter(self): ], ) + @skipUnlessDBFeature("supports_aggregate_order_by_clause") + def test_string_agg_empty_string_value(self): + Author.objects.create(name="", age=-1) + Author.objects.create(name="a", age=-2) + result = Author.objects.filter(age__lt=0).aggregate( + names=StringAgg("name", delimiter=Value(","), order_by="name") + ) + expected_value = ( + "a" if connection.features.interprets_empty_strings_as_nulls else ",a" + ) + self.assertEqual(result["names"], expected_value) + @skipUnlessDBFeature("supports_aggregate_order_by_clause") def test_string_agg_order_by(self): order_by_test_cases = (