diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py
index cfb662e..07e0117 100644
a
|
b
|
from django.db import (backend, connection, connections, DEFAULT_DB_ALIAS,
|
12 | 12 | IntegrityError, transaction) |
13 | 13 | from django.db.backends.signals import connection_created |
14 | 14 | from django.db.backends.postgresql_psycopg2 import version as pg_version |
| 15 | from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations |
15 | 16 | from django.db.utils import ConnectionHandler, DatabaseError, load_backend |
16 | 17 | from django.test import TestCase, skipUnlessDBFeature, TransactionTestCase |
17 | 18 | from django.test.utils import override_settings |
… |
… |
class BackendLoadingTests(TestCase):
|
618 | 619 | self.assertRaisesRegexp(ImproperlyConfigured, |
619 | 620 | "Try using django.db.backends.sqlite3 instead", |
620 | 621 | load_backend, 'sqlite3') |
| 622 | |
| 623 | |
| 624 | class PostgresChecks(unittest.TestCase): |
| 625 | def test_explicit_cast(self): |
| 626 | do = DatabaseOperations(connection=None) |
| 627 | self.assertEqual(do.lookup_cast('iexact'), 'UPPER(%s::text)') |
| 628 | self.assertEqual(do.lookup_cast('contains'), '%s::text') |
| 629 | self.assertEqual(do.lookup_cast('icontains'), 'UPPER(%s::text)') |
| 630 | self.assertEqual(do.lookup_cast('startswith'), '%s::text') |
| 631 | self.assertEqual(do.lookup_cast('istartswith'), 'UPPER(%s::text)') |
| 632 | self.assertEqual(do.lookup_cast('endswith'), '%s::text') |
| 633 | self.assertEqual(do.lookup_cast('iendswith'), 'UPPER(%s::text)') |