From 17d644c8e257c2ea5cc738fb7a9c47989e29bf09 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 3 Dec 2025 18:06:53 -0500 Subject: Added DatabaseFeatures.prohibits_dollar_signs_in_column_aliases. This is also applicable on CockroachDB. --- tests/annotations/tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index 10cd05db63..6336cabafa 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -1545,8 +1545,11 @@ class AliasTests(TestCase): qs = Book.objects.alias( **{"crafted_alia$": FilteredRelation("authors")} ).values("name", "crafted_alia$") - if connection.vendor == "postgresql": - msg = "Dollar signs are not permitted in column aliases on PostgreSQL." + if connection.features.prohibits_dollar_signs_in_column_aliases: + msg = ( + "Dollar signs are not permitted in column aliases on " + f"{connection.display_name}." + ) with self.assertRaisesMessage(ValueError, msg): list(qs) else: -- cgit v1.3