villebro commented on code in PR #26625:
URL: https://github.com/apache/superset/pull/26625#discussion_r1452662499


##########
tests/integration_tests/datasets/commands_tests.py:
##########
@@ -586,6 +586,21 @@ def test_create_dataset_command(self, mock_g, mock_g2):
             engine.execute("DROP TABLE test_create_dataset_command")
         db.session.commit()
 
+    @patch("superset.security.manager.g")
+    @patch("superset.commands.utils.g")
+    def test_create_dataset_command_not_allowed(self, mock_g, mock_g2):
+        mock_g.user = security_manager.find_user("gamma")
+        mock_g2.user = mock_g.user

Review Comment:
   Instead of mocking, couldn't we use `with override_user(user)` here?



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