This is an automated email from the ASF dual-hosted git repository.
suddjian pushed a commit to branch dashboard-dataset-endpoint
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/dashboard-dataset-endpoint by
this push:
new 8fbfa21 better test
8fbfa21 is described below
commit 8fbfa216b613a478e61025e8d2ea00c6b8e194e5
Author: David Aaron Suddjian <[email protected]>
AuthorDate: Thu Mar 11 13:48:31 2021 -0800
better test
---
tests/dashboards/api_tests.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/dashboards/api_tests.py b/tests/dashboards/api_tests.py
index 46fa203..fadabe2 100644
--- a/tests/dashboards/api_tests.py
+++ b/tests/dashboards/api_tests.py
@@ -178,8 +178,9 @@ class TestDashboardApi(SupersetTestCase,
ApiOwnersTestCaseMixin, InsertChartMixi
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))
+ expected_dataset_ids = set([s.datasource_id for s in dashboard.slices])
+ actual_dataset_ids = set([dataset["id"] for dataset in data["result"]])
+ self.assertEqual(actual_dataset_ids, expected_dataset_ids)
@pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
def test_get_dashboard_datasets_not_found(self):