fix: Refactor ownership checks and ensure consistency (#20499)

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2022-07-07 11:04:27 -07:00
committed by GitHub
parent e7b965a3b2
commit f0ca158989
107 changed files with 614 additions and 807 deletions

View File

@@ -109,7 +109,7 @@ class TestCreatePermalinkDataCommand(SupersetTestCase):
datasource = f"{dataset.id}__{DatasourceType.TABLE}"
command = CreateExplorePermalinkCommand(
mock_g.user, {"formData": {"datasource": datasource, "slice_id": slice.id}}
{"formData": {"datasource": datasource, "slice_id": slice.id}}
)
assert isinstance(command.run(), str)
@@ -130,10 +130,10 @@ class TestCreatePermalinkDataCommand(SupersetTestCase):
datasource = f"{dataset.id}__{DatasourceType.TABLE}"
key = CreateExplorePermalinkCommand(
mock_g.user, {"formData": {"datasource": datasource, "slice_id": slice.id}}
{"formData": {"datasource": datasource, "slice_id": slice.id}}
).run()
get_command = GetExplorePermalinkCommand(mock_g.user, key)
get_command = GetExplorePermalinkCommand(key)
cache_data = get_command.run()
assert cache_data.get("datasource") == datasource
@@ -166,7 +166,7 @@ class TestCreatePermalinkDataCommand(SupersetTestCase):
"formData": {"datasource": datasource_string, "slice_id": slice.id}
},
}
get_command = GetExplorePermalinkCommand(mock_g.user, "thisisallmocked")
get_command = GetExplorePermalinkCommand("thisisallmocked")
cache_data = get_command.run()
assert cache_data.get("datasource") == datasource_string