diff options
| author | Simon Charette <charette.s@gmail.com> | 2026-02-01 16:53:54 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-03-19 12:24:17 -0400 |
| commit | f05fac88c4699c6d04a8f1ac3328cf6c7bd39228 (patch) | |
| tree | 2399222aaed0ad6d9e466e914d178f08cd6e8337 /tests/filtered_relation | |
| parent | 4b2b4bf0ac2707dc9c4d51cabfa72168eaea95fe (diff) | |
Fixed #36795 -- Enforced quoting of all database object names.
This ensures all database identifiers are quoted independently of their orign
and most importantly that user provided aliases through annotate() and alias()
which paves the way for dropping the allow list of characters such aliases can
contain.
This will require adjustments to raw SQL interfaces such as RawSQL that might
make reference to ORM managed annotations as these will now be quoted.
The `SQLCompiler.quote_name_unless_alias` method is kept for now as an alias
for the newly introduced `.quote_name` method but will be duly deprecated in
a follow up commit.
Diffstat (limited to 'tests/filtered_relation')
| -rw-r--r-- | tests/filtered_relation/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/filtered_relation/tests.py b/tests/filtered_relation/tests.py index d15dd0d5f6..9047feba2d 100644 --- a/tests/filtered_relation/tests.py +++ b/tests/filtered_relation/tests.py @@ -210,8 +210,9 @@ class FilteredRelationTests(TestCase): ), ).filter(book_alice__isnull=False) self.assertIn( - "INNER JOIN {} book_alice ON".format( - connection.ops.quote_name("filtered_relation_book") + "INNER JOIN {} {} ON".format( + connection.ops.quote_name("filtered_relation_book"), + connection.ops.quote_name("book_alice"), ), str(queryset.query), ) |
