Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added test to confirm #12583 resolution

  • Loading branch information...
commit d902fd625d11bd8a69c3a26b5ed90eefa38d2f6d 1 parent 4d996b8
@claudep claudep authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 tests/backends/tests.py
View
16 tests/backends/tests.py
@@ -14,7 +14,6 @@
from django.db import (connection, connections, DEFAULT_DB_ALIAS,
DatabaseError, IntegrityError, transaction)
from django.db.backends.signals import connection_created
-from django.db.backends.sqlite3.base import DatabaseOperations
from django.db.backends.postgresql_psycopg2 import version as pg_version
from django.db.backends.utils import format_number, CursorWrapper
from django.db.models import Sum, Avg, Variance, StdDev
@@ -485,6 +484,8 @@ class SqliteChecks(TestCase):
@unittest.skipUnless(connection.vendor == 'sqlite',
"No need to do SQLite checks")
def test_convert_values_to_handle_null_value(self):
+ from django.db.backends.sqlite3.base import DatabaseOperations
+
database_operations = DatabaseOperations(connection)
self.assertEqual(
None,
@@ -1033,3 +1034,16 @@ def test_select_unicode_array(self):
a = ["ᄲawef"]
b = self.select(a)
self.assertEqual(a[0], b[0])
+
+
+@unittest.skipUnless(
+ connection.vendor == 'postgresql',
+ "This test applies only to PostgreSQL")
+class PostgresLookupCastTests(TestCase):
+ def test_lookup_cast(self):
+ from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
+
+ do = DatabaseOperations(connection=None)
+ for lookup in ('iexact', 'contains', 'icontains', 'startswith',
+ 'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'):
+ self.assertIn('::text', do.lookup_cast(lookup))
Please sign in to comment.
Something went wrong with that request. Please try again.