mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: set importer as owner (#16656)
* fix: set importer as owner * Fix tests
This commit is contained in:
@@ -463,8 +463,10 @@ class TestImportDashboardsCommand(SupersetTestCase):
|
||||
db.session.delete(dataset)
|
||||
db.session.commit()
|
||||
|
||||
def test_import_v1_dashboard(self):
|
||||
@patch("superset.dashboards.commands.importers.v1.utils.g")
|
||||
def test_import_v1_dashboard(self, mock_g):
|
||||
"""Test that we can import a dashboard"""
|
||||
mock_g.user = security_manager.find_user("admin")
|
||||
contents = {
|
||||
"metadata.yaml": yaml.safe_dump(dashboard_metadata_config),
|
||||
"databases/imported_database.yaml": yaml.safe_dump(database_config),
|
||||
@@ -544,6 +546,12 @@ class TestImportDashboardsCommand(SupersetTestCase):
|
||||
database = dataset.database
|
||||
assert str(database.uuid) == database_config["uuid"]
|
||||
|
||||
assert dashboard.owners == [mock_g.user]
|
||||
|
||||
dashboard.owners = []
|
||||
chart.owners = []
|
||||
dataset.owners = []
|
||||
database.owners = []
|
||||
db.session.delete(dashboard)
|
||||
db.session.delete(chart)
|
||||
db.session.delete(dataset)
|
||||
|
||||
Reference in New Issue
Block a user