You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/06/16 19:23:11 UTC

(superset) 01/01: test(security): regression coverage for #36130 FAB permission view templates

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch test/security-fab-views-regression
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4d3086ed15faaa9cf35604c3dfa86b3c6ebe2906
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Tue Jun 16 12:22:45 2026 -0700

    test(security): regression coverage for #36130 FAB permission view templates
    
    The FAB permission views (PermissionModelView, PermissionViewModelView)
    previously used a custom list widget pointing at
    `superset/fab_overrides/list.html`, which was deleted during a Jinja cleanup.
    With the security views enabled, this raised `TemplateNotFound` and returned a
    500. The widget references were removed in #36058; this test guards against a
    regression by asserting each view's list widget template resolves.
    
    Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
 tests/integration_tests/core_tests.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py
index 4dea036e7a5..cd2f29ec6ae 100644
--- a/tests/integration_tests/core_tests.py
+++ b/tests/integration_tests/core_tests.py
@@ -29,6 +29,7 @@ import pandas as pd
 import pytest
 import pytz
 import sqlalchemy as sqla
+from flask import current_app
 from flask_babel import lazy_gettext as _
 from sqlalchemy.exc import SQLAlchemyError
 
@@ -333,6 +334,21 @@ class TestCore(SupersetTestCase):
         assert "Charts" in self.get_resp("/chart/list/")
         assert "Dashboards" in self.get_resp("/dashboard/list/")
 
+    def test_security_fab_views_have_valid_list_template(self):
+        # Regression test for #36130: the FAB permission views pointed at a custom
+        # list template (superset/fab_overrides/list.html) that was deleted during a
+        # cleanup, so they 500'd with TemplateNotFound. Ensure each view's list
+        # widget template still resolves in the Jinja environment.
+        from superset.security.manager import (
+            PermissionModelView,
+            PermissionViewModelView,
+        )
+
+        for view_cls in (PermissionModelView, PermissionViewModelView):
+            template = view_cls.list_widget.template
+            # Raises TemplateNotFound if the template is missing (the #36130 bug).
+            current_app.jinja_env.get_template(template)
+
     def test_templated_sql_json(self):
         if superset.utils.database.get_example_database().backend == "presto":
             # TODO: make it work for presto