Skip to content

Commit

Permalink
fix(test): make test_clean_requests_after_schema_grant more idempotent (
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud authored Apr 9, 2022
1 parent 9a9e3b6 commit 738bd04
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/integration_tests/access_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ def test_clean_requests_after_schema_grant(self):
.filter_by(table_name="wb_health_population")
.first()
)
original_schema = ds.schema

ds.schema = "temp_schema"
security_manager.add_permission_view_menu("schema_access", ds.schema_perm)
Expand All @@ -394,13 +395,7 @@ def test_clean_requests_after_schema_grant(self):
gamma_user = security_manager.find_user(username="gamma")
gamma_user.roles.remove(security_manager.find_role(SCHEMA_ACCESS_ROLE))

ds = (
session.query(SqlaTable)
.filter_by(table_name="wb_health_population")
.first()
)
ds.schema = None

ds.schema = original_schema
session.commit()

@mock.patch("superset.utils.core.send_mime_email")
Expand Down

0 comments on commit 738bd04

Please sign in to comment.