mirror of
https://github.com/apache/superset.git
synced 2026-04-18 07:35:09 +00:00
fix: allow db driver distinction on enforced URI params (#23769)
This commit is contained in:
committed by
GitHub
parent
adde66785c
commit
6ae5388dcf
@@ -194,7 +194,7 @@ class TestDatabaseModel(SupersetTestCase):
|
||||
@mock.patch("superset.models.core.create_engine")
|
||||
def test_adjust_engine_params_mysql(self, mocked_create_engine):
|
||||
model = Database(
|
||||
database_name="test_database",
|
||||
database_name="test_database1",
|
||||
sqlalchemy_uri="mysql://user:password@localhost",
|
||||
)
|
||||
model._get_sqla_engine()
|
||||
@@ -203,6 +203,16 @@ class TestDatabaseModel(SupersetTestCase):
|
||||
assert str(call_args[0][0]) == "mysql://user:password@localhost"
|
||||
assert call_args[1]["connect_args"]["local_infile"] == 0
|
||||
|
||||
model = Database(
|
||||
database_name="test_database2",
|
||||
sqlalchemy_uri="mysql+mysqlconnector://user:password@localhost",
|
||||
)
|
||||
model._get_sqla_engine()
|
||||
call_args = mocked_create_engine.call_args
|
||||
|
||||
assert str(call_args[0][0]) == "mysql+mysqlconnector://user:password@localhost"
|
||||
assert call_args[1]["connect_args"]["allow_local_infile"] == 0
|
||||
|
||||
@mock.patch("superset.models.core.create_engine")
|
||||
def test_impersonate_user_trino(self, mocked_create_engine):
|
||||
principal_user = security_manager.find_user(username="gamma")
|
||||
|
||||
Reference in New Issue
Block a user