diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-27 21:28:10 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-27 21:29:47 +0100 |
| commit | d42e47f572446e8e3f5974431a67e33eb613f845 (patch) | |
| tree | a83ce1ce0896a7a8111139391f9d6e8705e0d413 | |
| parent | f210ad1b980a40345ab66b2f0c4f5b9610eb07ac (diff) | |
[4.2.x] Refs #34255 -- Skipped test_group_by_nested_expression_with_params test on PostgreSQL when server-side binding cursors are used.
Thanks Tim Graham for the review.
Backport of 82dad11bfe45f96f15e2330f58f62919cab9f14c from main
| -rw-r--r-- | django/db/backends/postgresql/features.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index 6c20dd87f0..aa68465df9 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -85,6 +85,26 @@ class DatabaseFeatures(BaseDatabaseFeatures): } @cached_property + def django_test_expected_failures(self): + expected_failures = set() + if self.uses_server_side_binding: + expected_failures.update( + { + # Parameters passed to expressions in SELECT and GROUP BY + # clauses are not recognized as the same values when using + # server-side binding cursors (#34255). + "aggregation.tests.AggregateTestCase." + "test_group_by_nested_expression_with_params", + } + ) + return expected_failures + + @cached_property + def uses_server_side_binding(self): + options = self.connection.settings_dict["OPTIONS"] + return is_psycopg3 and options.get("server_side_binding") is True + + @cached_property def prohibits_null_characters_in_text_exception(self): if is_psycopg3: return DataError, "PostgreSQL text fields cannot contain NUL (0x00) bytes" |
