bito-code-review[bot] commented on code in PR #44101:
URL: https://github.com/apache/superset/pull/44101#discussion_r4174113696


##########
tests/integration_tests/core_tests.py:
##########
@@ -953,6 +953,49 @@ def test_dashboard_permalink_returns_404_for_missing_state(
         assert resp.status_code == 404
         assert "Location" not in resp.headers
 
+    def test_extension_view_anonymous_redirects_to_login(self):
+        resp = self.client.get("/extensions/view/my-ext.settings")
+
+        expected_url = "/login/?next=%2Fextensions%2Fview%2Fmy-ext.settings"
+
+        assert resp.status_code == 302
+        assert resp.headers["Location"] == expected_url
+
+    def test_extension_view_authenticated_returns_spa_shell(self):
+        self.login(ADMIN_USERNAME)
+
+        resp = self.client.get("/extensions/view/my-ext.settings")
+
+        assert resp.status_code == 200
+        assert b'id="app"' in resp.data
+
+    def 
test_extension_view_custom_role_without_extension_permission_returns_spa_shell(
+        self,
+    ):
+        # A custom role is never backfilled with the FAB-generated
+        # `can_extension_view` permission by role sync; the route is a
+        # login-only shell page, so such users shouldn't get a 403.
+        role_name = "ExtensionViewCustomRole"
+        username = "extension_view_custom_user"
+        role = security_manager.add_role(role_name)

Review Comment:
   <!-- Bito Reply -->
   The reviewer's suggestion to add docstrings and type annotations is intended 
to improve code clarity and maintainability. While you have noted that 
neighboring tests in the file omit these, following the suggestion would align 
the new code with standard documentation and typing practices. You may choose 
to apply these updates to ensure consistency with broader project standards, or 
maintain the current style if local file consistency is the priority.



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