mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat!: pass datasource_type and datasource_id to form_data (#19981)
* pass datasource_type and datasource_id to form_data * add datasource_type to delete command * add datasource_type to delete command * fix old keys implementation * add more tests
This commit is contained in:
committed by
GitHub
parent
a813528958
commit
32bb1ce3ff
@@ -520,7 +520,13 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
|
||||
response = json.loads(rv.data.decode("utf-8"))
|
||||
self.assertEqual(
|
||||
response,
|
||||
{"message": {"datasource_type": ["Must be one of: druid, table, view."]}},
|
||||
{
|
||||
"message": {
|
||||
"datasource_type": [
|
||||
"Must be one of: sl_table, table, dataset, query, saved_query, view."
|
||||
]
|
||||
}
|
||||
},
|
||||
)
|
||||
chart_data = {
|
||||
"slice_name": "title1",
|
||||
@@ -531,7 +537,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
|
||||
self.assertEqual(rv.status_code, 422)
|
||||
response = json.loads(rv.data.decode("utf-8"))
|
||||
self.assertEqual(
|
||||
response, {"message": {"datasource_id": ["Dataset does not exist"]}}
|
||||
response, {"message": {"datasource_id": ["Datasource does not exist"]}}
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
|
||||
@@ -686,7 +692,13 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
|
||||
response = json.loads(rv.data.decode("utf-8"))
|
||||
self.assertEqual(
|
||||
response,
|
||||
{"message": {"datasource_type": ["Must be one of: druid, table, view."]}},
|
||||
{
|
||||
"message": {
|
||||
"datasource_type": [
|
||||
"Must be one of: sl_table, table, dataset, query, saved_query, view."
|
||||
]
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
chart_data = {"datasource_id": 0, "datasource_type": "table"}
|
||||
@@ -694,7 +706,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
|
||||
self.assertEqual(rv.status_code, 422)
|
||||
response = json.loads(rv.data.decode("utf-8"))
|
||||
self.assertEqual(
|
||||
response, {"message": {"datasource_id": ["Dataset does not exist"]}}
|
||||
response, {"message": {"datasource_id": ["Datasource does not exist"]}}
|
||||
)
|
||||
|
||||
db.session.delete(chart)
|
||||
|
||||
Reference in New Issue
Block a user