From 26cf408db032a43904394600d387d2c90d7158fe Mon Sep 17 00:00:00 2001 From: hughhhh Date: Wed, 4 Jan 2023 18:17:29 -0500 Subject: [PATCH] one more time --- tests/integration_tests/core_tests.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py index 6e9f1a8d33c48..4ca9db3c196e0 100644 --- a/tests/integration_tests/core_tests.py +++ b/tests/integration_tests/core_tests.py @@ -79,6 +79,7 @@ load_world_bank_dashboard_with_slices, load_world_bank_data, ) +from tests.integration_tests.conftest import CTAS_SCHEMA_NAME logger = logging.getLogger(__name__) @@ -1673,6 +1674,22 @@ def test_explore_redirect(self, mock_command: mock.Mock): ) self.assertRedirects(rv, f"/explore/?form_data_key={random_key}") + def test_has_table_by_name(self): + from tests.integration_tests.conftest import CTAS_SCHEMA_NAME + + example_db = superset.utils.database.get_example_database() + with example_db.get_sqla_engine_with_context() as engine: + engine.execute( + f"CREATE TABLE {CTAS_SCHEMA_NAME}.birth_names AS SELECT 2 as two" + ) + + assert ( + example_db.has_table_by_name( + table_name="birth_names", schema=CTAS_SCHEMA_NAME + ) + is True + ) + if __name__ == "__main__": unittest.main()