summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/features.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-27 21:28:10 +0100
committerGitHub <noreply@github.com>2023-01-27 21:28:10 +0100
commit82dad11bfe45f96f15e2330f58f62919cab9f14c (patch)
tree4a57975a4d54d8b25179bfdb5851986c6cc4059b /django/db/backends/postgresql/features.py
parent246eb4836a6fb967880f838aa0d22ecfdca8b6f1 (diff)
downloaddjango-82dad11bfe45f96f15e2330f58f62919cab9f14c.tar.gz
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.
Diffstat (limited to 'django/db/backends/postgresql/features.py')
-rw-r--r--django/db/backends/postgresql/features.py20
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"