mirror of
https://github.com/apache/superset.git
synced 2026-04-11 04:15:33 +00:00
fix(api): apply dashboard filter to get dash charts API (#13173)
* fix(api): apply dashboard filter to get dash charts API * lint
This commit is contained in:
committed by
GitHub
parent
2d95bfcd99
commit
4c544500a7
@@ -174,6 +174,7 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixi
|
||||
"""
|
||||
Dashboard API: Test getting charts belonging to a dashboard
|
||||
"""
|
||||
self.login(username="admin")
|
||||
dashboard = self.dashboards[0]
|
||||
uri = f"api/v1/dashboard/{dashboard.id}/charts"
|
||||
response = self.get_assert_metric(uri, "get_charts")
|
||||
@@ -195,6 +196,17 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixi
|
||||
response = self.get_assert_metric(uri, "get_charts")
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
@pytest.mark.usefixtures("create_dashboards")
|
||||
def test_get_dashboard_charts_not_allowed(self):
|
||||
"""
|
||||
Dashboard API: Test getting charts on a dashboard a user does not have access to
|
||||
"""
|
||||
self.login(username="gamma")
|
||||
dashboard = self.dashboards[0]
|
||||
uri = f"api/v1/dashboard/{dashboard.id}/charts"
|
||||
response = self.get_assert_metric(uri, "get_charts")
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
@pytest.mark.usefixtures("create_dashboards")
|
||||
def test_get_dashboard_charts_empty(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user