summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/suite/test_reflection.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py
index 88189c2d9..6fbd74689 100644
--- a/lib/sqlalchemy/testing/suite/test_reflection.py
+++ b/lib/sqlalchemy/testing/suite/test_reflection.py
@@ -77,6 +77,32 @@ class HasTableTest(fixtures.TablesTest):
)
)
+ @testing.requires.views
+ def test_has_table_view(self, connection):
+ query = "CREATE VIEW vv AS SELECT * FROM test_table"
+ connection.execute(sa.sql.text(query))
+ insp = inspect(connection)
+ try:
+ is_true(insp.has_table("vv"))
+ finally:
+ connection.execute(sa.sql.text("DROP VIEW vv"))
+
+ @testing.requires.views
+ @testing.requires.schemas
+ def test_has_table_view_schema(self, connection):
+ query = "CREATE VIEW %s.vv AS SELECT * FROM %s.test_table_s" % (
+ config.test_schema,
+ config.test_schema,
+ )
+ connection.execute(sa.sql.text(query))
+ insp = inspect(connection)
+ try:
+ is_true(insp.has_table("vv", config.test_schema))
+ finally:
+ connection.execute(
+ sa.sql.text("DROP VIEW %s.vv" % config.test_schema)
+ )
+
class HasIndexTest(fixtures.TablesTest):
__backend__ = True