mirror of
https://github.com/apache/superset.git
synced 2026-04-25 02:55:07 +00:00
feat: add export_related flag (#19215)
* feat: add export_related flag * Fix lint
This commit is contained in:
@@ -219,6 +219,26 @@ class TestExportDatasetsCommand(SupersetTestCase):
|
||||
"database_uuid",
|
||||
]
|
||||
|
||||
@patch("superset.security.manager.g")
|
||||
@pytest.mark.usefixtures("load_energy_table_with_slice")
|
||||
def test_export_dataset_command_no_related(self, mock_g):
|
||||
"""
|
||||
Test that only datasets are exported when export_related=False.
|
||||
"""
|
||||
mock_g.user = security_manager.find_user("admin")
|
||||
|
||||
example_db = get_example_database()
|
||||
example_dataset = _get_table_from_list_by_name(
|
||||
"energy_usage", example_db.tables
|
||||
)
|
||||
command = ExportDatasetsCommand([example_dataset.id], export_related=False)
|
||||
contents = dict(command.run())
|
||||
|
||||
assert list(contents.keys()) == [
|
||||
"metadata.yaml",
|
||||
"datasets/examples/energy_usage.yaml",
|
||||
]
|
||||
|
||||
|
||||
class TestImportDatasetsCommand(SupersetTestCase):
|
||||
@pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
|
||||
|
||||
Reference in New Issue
Block a user