diff options
Diffstat (limited to 'test/dialect/test_sqlite.py')
-rw-r--r-- | test/dialect/test_sqlite.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index 96171f4f7..97962a54a 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -401,7 +401,7 @@ class DialectTest(fixtures.TestBase, AssertsExecutionResults): meta.drop_all() @testing.provide_metadata - def test_quoted_identifiers_one(self): + def test_quoted_identifiers_functional_one(self): """Tests autoload of tables created with quoted column names.""" metadata = self.metadata @@ -427,7 +427,7 @@ class DialectTest(fixtures.TestBase, AssertsExecutionResults): == table2.c.id) @testing.provide_metadata - def test_quoted_identifiers_two(self): + def test_quoted_identifiers_functional_two(self): """"test the edgiest of edge cases, quoted table/col names that start and end with quotes. @@ -462,6 +462,30 @@ class DialectTest(fixtures.TestBase, AssertsExecutionResults): #assert j.onclause.compare(table1.c['"id"'] # == table2.c['"aid"']) + def test_legacy_quoted_identifiers_unit(self): + dialect = sqlite.dialect() + dialect._broken_fk_pragma_quotes = True + + + for row in [ + (0, 'target', 'tid', 'id'), + (0, '"target"', 'tid', 'id'), + (0, '[target]', 'tid', 'id'), + (0, "'target'", 'tid', 'id'), + (0, '`target`', 'tid', 'id'), + ]: + fks = {} + fkeys = [] + dialect._parse_fk(fks, fkeys, *row) + eq_(fkeys, [{ + 'referred_table': 'target', + 'referred_columns': ['id'], + 'referred_schema': None, + 'name': None, + 'constrained_columns': ['tid'] + }]) + + def test_attached_as_schema(self): cx = testing.db.connect() try: |