villebro commented on a change in pull request #13523:
URL: https://github.com/apache/superset/pull/13523#discussion_r592115045
##########
File path: tests/dashboards/api_tests.py
##########
@@ -170,6 +170,31 @@ def create_dashboard_with_report(self):
db.session.delete(dashboard)
db.session.commit()
+ @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
+ def test_get_dashboard_datasets(self):
+ self.login(username="admin")
+ uri = "api/v1/dashboard/world_health/datasets"
+ response = self.get_assert_metric(uri, "get_datasets")
+ self.assertEqual(response.status_code, 200)
+ data = json.loads(response.data.decode("utf-8"))
+ dashboard = Dashboard.get("world_health")
+ dataset_ids = set([s.datasource_id for s in dashboard.slices])
+ self.assertEqual(len(data["result"]), len(dataset_ids))
Review comment:
nit: we could probably compare a set of `id`s from `data["result"]` with
`dataset_ids` here to make sure the ids are identical.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]