fix(ssh-tunnel): fix dataset creation flow through modal for DB with tunnel (#22581)

This commit is contained in:
Hugh A. Miles II
2023-01-06 13:52:05 -05:00
committed by GitHub
parent af34e454be
commit d18c7d6128
2 changed files with 25 additions and 11 deletions

View File

@@ -27,10 +27,12 @@ from typing import Dict, List
from urllib.parse import quote
import superset.utils.database
from superset.utils.core import backend
from tests.integration_tests.fixtures.birth_names_dashboard import (
load_birth_names_dashboard_with_slices,
load_birth_names_data,
)
from sqlalchemy import Table
import pytest
import pytz
@@ -79,6 +81,7 @@ from tests.integration_tests.fixtures.world_bank_dashboard import (
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 +1676,16 @@ class TestCore(SupersetTestCase):
)
self.assertRedirects(rv, f"/explore/?form_data_key={random_key}")
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_has_table_by_name(self):
if backend() in ("sqlite", "mysql"):
return
example_db = superset.utils.database.get_example_database()
assert (
example_db.has_table_by_name(table_name="birth_names", schema="public")
is True
)
if __name__ == "__main__":
unittest.main()