mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore(key-value): convert command to dao (#29344)
This commit is contained in:
@@ -133,11 +133,11 @@ class TestCreatePermalinkDataCommand(SupersetTestCase):
|
||||
assert cache_data.get("datasource") == datasource
|
||||
|
||||
@patch("superset.security.manager.g")
|
||||
@patch("superset.commands.key_value.get.GetKeyValueCommand.run")
|
||||
@patch("superset.daos.key_value.KeyValueDAO.get_value")
|
||||
@patch("superset.commands.explore.permalink.get.decode_permalink_id")
|
||||
@pytest.mark.usefixtures("create_dataset", "create_slice")
|
||||
def test_get_permalink_command_with_old_dataset_key(
|
||||
self, decode_id_mock, get_kv_command_mock, mock_g
|
||||
self, decode_id_mock, kv_get_value_mock, mock_g
|
||||
):
|
||||
mock_g.user = security_manager.find_user("admin")
|
||||
app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"] = {
|
||||
@@ -149,13 +149,14 @@ class TestCreatePermalinkDataCommand(SupersetTestCase):
|
||||
)
|
||||
slice = db.session.query(Slice).filter_by(slice_name="slice_name").first()
|
||||
|
||||
datasource_string = f"{dataset.id}__{DatasourceType.TABLE}"
|
||||
datasource_string = f"{dataset.id}__{DatasourceType.TABLE.value}"
|
||||
|
||||
decode_id_mock.return_value = "123456"
|
||||
get_kv_command_mock.return_value = {
|
||||
kv_get_value_mock.return_value = {
|
||||
"chartId": slice.id,
|
||||
"datasetId": dataset.id,
|
||||
"datasource": datasource_string,
|
||||
"datasourceType": DatasourceType.TABLE.value,
|
||||
"state": {
|
||||
"formData": {"datasource": datasource_string, "slice_id": slice.id}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user