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


##########
tests/unit_tests/commands/dashboard/update_test.py:
##########
@@ -166,3 +171,85 @@ def 
test_process_native_filter_diff_only_touches_reports_on_the_updated_dashboar
     # NATIVE_FILTER-2 is the only one dropped from the new metadata.
     
report_dao.find_by_native_filter_id.assert_called_once_with("NATIVE_FILTER-2")
     report_dao.update.assert_called_once_with(own_report, {"active": False})
+
+
+def _mock_dependencies(mocker: MockerFixture, existing_css: str) -> None:
+    model = mocker.MagicMock(id=1, tags=[], css=existing_css)
+    mocker.patch(
+        "superset.commands.dashboard.update.DashboardDAO.find_by_id",
+        return_value=model,
+    )

Review Comment:
   <!-- Bito Reply -->
   The update to set `is_managed_externally=False` in the mock is appropriate. 
This change ensures the mock correctly simulates a dashboard that is not 
managed externally, preventing the `DashboardForbiddenError` during validation 
and allowing the tests to proceed as expected.
   
   **tests/unit_tests/commands/dashboard/update_test.py**
   ```
   def _mock_dependencies(mocker: MockerFixture, existing_css: str) -> None:
       model = mocker.MagicMock(id=1, tags=[], css=existing_css, 
is_managed_externally=False)
       mocker.patch(
           "superset.commands.dashboard.update.DashboardDAO.find_by_id",
           return_value=model,
       )
   ```



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