betodealmeida commented on code in PR #37059:
URL: https://github.com/apache/superset/pull/37059#discussion_r2688478140


##########
tests/unit_tests/views/test_base_theme_helpers.py:
##########
@@ -530,3 +530,175 @@ def test_ui_admin_disabled_no_config_themes(self, 
mock_get_config, mock_app):
         assert result["theme"]["enableUiThemeAdministration"] is False
         assert result["theme"]["default"] == {}
         assert result["theme"]["dark"] == {}
+
+
+class TestBrandAppNameFallback:
+    """Test brandAppName fallback mechanism for APP_NAME migration (issue 
#34865)"""
+
+    @patch("superset.views.base.get_spa_payload")
+    @patch("superset.views.base.app")
+    def test_brandappname_uses_theme_value_when_set(
+        self, mock_app, mock_payload
+    ):
+        """Test that explicit brandAppName in theme takes precedence"""
+        from superset.views.base import get_spa_template_context
+
+        mock_app.config = MagicMock()
+        mock_app.config.get.side_effect = lambda k, d=None: {
+            "APP_NAME": "Fallback App Name",
+        }.get(k, d)

Review Comment:
   Let's do this ^



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