eschutho commented on code in PR #29522:
URL: https://github.com/apache/superset/pull/29522#discussion_r1710235363


##########
tests/unit_tests/databases/commands/importers/v1/import_test.py:
##########
@@ -172,6 +172,30 @@ def test_import_database_with_version(mocker: 
MockerFixture, session: Session) -
     assert json.loads(database.extra)["version"] == "1.1.1"
 
 
+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)
+

Review Comment:
   ```suggestion
   mocker.patch("superset.commands.database.importers.v1.utils.add_permissions")
   ```



-- 
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]

Reply via email to