summaryrefslogtreecommitdiff
path: root/tests/backends/postgresql
diff options
context:
space:
mode:
Diffstat (limited to 'tests/backends/postgresql')
-rw-r--r--tests/backends/postgresql/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py
index 31aac022c8..a045195991 100644
--- a/tests/backends/postgresql/tests.py
+++ b/tests/backends/postgresql/tests.py
@@ -369,6 +369,20 @@ class Tests(TestCase):
with self.subTest(lookup=lookup):
self.assertIn("::text", do.lookup_cast(lookup))
+ def test_lookup_cast_isnull_noop(self):
+ from django.db.backends.postgresql.operations import DatabaseOperations
+
+ do = DatabaseOperations(connection=None)
+ # Using __isnull lookup doesn't require casting.
+ tests = [
+ "CharField",
+ "EmailField",
+ "TextField",
+ ]
+ for field_type in tests:
+ with self.subTest(field_type=field_type):
+ self.assertEqual(do.lookup_cast("isnull", field_type), "%s")
+
def test_correct_extraction_psycopg_version(self):
from django.db.backends.postgresql.base import Database, psycopg_version