forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove
update_charts_owners
(apache#25843)
- Loading branch information
1 parent
ae619b1
commit 60e1526
Showing
4 changed files
with
1 addition
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1378,55 +1378,6 @@ def test_dashboard_get_no_username(self): | |
db.session.delete(model) | ||
db.session.commit() | ||
|
||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_update_dashboard_chart_owners(self): | ||
""" | ||
Dashboard API: Test update chart owners | ||
""" | ||
user_alpha1 = self.create_user( | ||
"alpha1", "password", "Alpha", email="[email protected]" | ||
) | ||
user_alpha2 = self.create_user( | ||
"alpha2", "password", "Alpha", email="[email protected]" | ||
) | ||
admin = self.get_user("admin") | ||
slices = [] | ||
slices.append( | ||
db.session.query(Slice).filter_by(slice_name="Girl Name Cloud").first() | ||
) | ||
slices.append(db.session.query(Slice).filter_by(slice_name="Trends").first()) | ||
slices.append(db.session.query(Slice).filter_by(slice_name="Boys").first()) | ||
|
||
dashboard = self.insert_dashboard( | ||
"title1", | ||
"slug1", | ||
[admin.id], | ||
slices=slices, | ||
) | ||
self.login(username="admin") | ||
uri = f"api/v1/dashboard/{dashboard.id}" | ||
dashboard_data = {"owners": [user_alpha1.id, user_alpha2.id]} | ||
rv = self.client.put(uri, json=dashboard_data) | ||
self.assertEqual(rv.status_code, 200) | ||
|
||
# verify slices owners include alpha1 and alpha2 users | ||
slices_ids = [slice.id for slice in slices] | ||
# Refetch Slices | ||
slices = db.session.query(Slice).filter(Slice.id.in_(slices_ids)).all() | ||
for slice in slices: | ||
self.assertIn(user_alpha1, slice.owners) | ||
self.assertIn(user_alpha2, slice.owners) | ||
self.assertNotIn(admin, slice.owners) | ||
# Revert owners on slice | ||
slice.owners = [] | ||
db.session.commit() | ||
|
||
# Rollback changes | ||
db.session.delete(dashboard) | ||
db.session.delete(user_alpha1) | ||
db.session.delete(user_alpha2) | ||
db.session.commit() | ||
|
||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_update_dashboard_chart_owners_propagation(self): | ||
""" | ||
|