class HasIndexTest(fixtures.TablesTest):
__backend__ = True
+ __requires__ = ("index_reflection",)
@classmethod
def define_tables(cls, metadata):
"""tests for #10275"""
__backend__ = True
+ __requires__ = ("foreign_key_constraint_reflection",)
@testing.combinations(
("id",), ("(3)",), ("col%p",), ("[brack]",), argnames="columnname"
assert insp.get_pk_constraint(name)
@quote_fixtures
+ @testing.requires.foreign_key_constraint_reflection
def test_get_foreign_keys(self, name):
insp = inspect(config.db)
assert insp.get_foreign_keys(name)
@quote_fixtures
+ @testing.requires.index_reflection
def test_get_indexes(self, name):
insp = inspect(config.db)
assert insp.get_indexes(name)
col = self.tables.some_table.c.data
self._test(col.startswith("ab%c"), {1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
+ @testing.requires.like_escapes
def test_startswith_autoescape(self):
col = self.tables.some_table.c.data
self._test(col.startswith("ab%c", autoescape=True), {3})
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
)
+ @testing.requires.like_escapes
def test_startswith_escape(self):
col = self.tables.some_table.c.data
self._test(col.startswith("ab##c", escape="#"), {7})
+ @testing.requires.like_escapes
def test_startswith_autoescape_escape(self):
col = self.tables.some_table.c.data
self._test(col.startswith("ab%c", autoescape=True, escape="#"), {3})
col.endswith(literal_column("'e%fg'")), {1, 2, 3, 4, 5, 6, 7, 8, 9}
)
+ @testing.requires.like_escapes
def test_endswith_autoescape(self):
col = self.tables.some_table.c.data
self._test(col.endswith("e%fg", autoescape=True), {6})
+ @testing.requires.like_escapes
def test_endswith_escape(self):
col = self.tables.some_table.c.data
self._test(col.endswith("e##fg", escape="#"), {9})
+ @testing.requires.like_escapes
def test_endswith_autoescape_escape(self):
col = self.tables.some_table.c.data
self._test(col.endswith("e%fg", autoescape=True, escape="#"), {6})
col = self.tables.some_table.c.data
self._test(col.contains("b%cde"), {1, 2, 3, 4, 5, 6, 7, 8, 9})
+ @testing.requires.like_escapes
def test_contains_autoescape(self):
col = self.tables.some_table.c.data
self._test(col.contains("b%cde", autoescape=True), {3})
+ @testing.requires.like_escapes
def test_contains_escape(self):
col = self.tables.some_table.c.data
self._test(col.contains("b##cde", escape="#"), {7})
+ @testing.requires.like_escapes
def test_contains_autoescape_escape(self):
col = self.tables.some_table.c.data
self._test(col.contains("b%cd", autoescape=True, escape="#"), {3})
class BinaryTest(_LiteralRoundTripFixture, fixtures.TablesTest):
__backend__ = True
+ __requires__ = ("binary_literals",)
@classmethod
def define_tables(cls, metadata):
return datatype, compare_value, p_s
+ @testing.requires.legacy_unconditional_json_extract
@_index_fixtures(False)
def test_index_typed_access(self, datatype, value):
data_table = self.tables.data_table
eq_(roundtrip, compare_value)
is_(type(roundtrip), type(compare_value))
+ @testing.requires.legacy_unconditional_json_extract
@_index_fixtures(True)
def test_index_typed_comparison(self, datatype, value):
data_table = self.tables.data_table
# make sure we get a row even if value is None
eq_(row, (compare_value,))
+ @testing.requires.legacy_unconditional_json_extract
@_index_fixtures(True)
def test_path_typed_comparison(self, datatype, value):
data_table = self.tables.data_table