eschutho commented on PR #29522:
URL: https://github.com/apache/superset/pull/29522#issuecomment-2269907517
Can we add a unit test with the new param? Here's an example in
`tests/unit_tests/databases/commands/importers/v1/import_test.py`
```
def test_import_database_with_user_impersonation(
mocker: MockerFixture,
session: Session,
) -> None:
"""
Test importing a database that is managed externally.
"""
from superset import security_manager
from superset.commands.database.importers.v1.utils import import_database
from superset.models.core import Database
from tests.integration_tests.fixtures.importexport import database_config
mocker.patch.object(security_manager, "can_access", return_value=True)
engine = db.session.get_bind()
Database.metadata.create_all(engine) # pylint: disable=no-member
config = copy.deepcopy(database_config)
config["impersonate_user"] = True
database = import_database(config)
assert database.impersonate_user is True
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]