Ejemplo n.º 1
0
 def test_lookup_cast(self):
     from django.db.backends.postgresql.operations import DatabaseOperations
     do = DatabaseOperations(connection=None)
     lookups = (
         'iexact', 'contains', 'icontains', 'startswith', 'istartswith',
         'endswith', 'iendswith', 'regex', 'iregex',
     )
     for lookup in lookups:
         with self.subTest(lookup=lookup):
             self.assertIn('::text', do.lookup_cast(lookup))
     for lookup in lookups:
         for field_type in ('CICharField', 'CIEmailField', 'CITextField'):
             with self.subTest(lookup=lookup, field_type=field_type):
                 self.assertIn('::citext', do.lookup_cast(lookup, internal_type=field_type))
Ejemplo n.º 2
0
 def test_lookup_cast(self):
     from django.db.backends.postgresql.operations import DatabaseOperations
     do = DatabaseOperations(connection=None)
     lookups = (
         'iexact', 'contains', 'icontains', 'startswith', 'istartswith',
         'endswith', 'iendswith', 'regex', 'iregex',
     )
     for lookup in lookups:
         with self.subTest(lookup=lookup):
             self.assertIn('::text', do.lookup_cast(lookup))
     for lookup in lookups:
         for field_type in ('CICharField', 'CIEmailField', 'CITextField'):
             with self.subTest(lookup=lookup, field_type=field_type):
                 self.assertIn('::citext', do.lookup_cast(lookup, internal_type=field_type))
Ejemplo n.º 3
0
    def test_lookup_cast(self):
        from django.db.backends.postgresql.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))
Ejemplo n.º 4
0
    def test_lookup_cast(self):
        from django.db.backends.postgresql.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))
Ejemplo n.º 5
0
    def test_lookup_cast(self):
        from django.db.backends.postgresql.operations import DatabaseOperations

        do = DatabaseOperations(connection=None)
        lookups = (
            "iexact",
            "contains",
            "icontains",
            "startswith",
            "istartswith",
            "endswith",
            "iendswith",
            "regex",
            "iregex",
        )
        for lookup in lookups:
            with self.subTest(lookup=lookup):
                self.assertIn("::text", do.lookup_cast(lookup))
        for lookup in lookups:
            for field_type in ("CICharField", "CIEmailField", "CITextField"):
                with self.subTest(lookup=lookup, field_type=field_type):
                    self.assertIn(
                        "::citext",
                        do.lookup_cast(lookup, internal_type=field_type))