Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrag1 committed Aug 3, 2023
1 parent a3c5038 commit af8fefc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from superset import db
from superset.connectors.sqla.models import SqlaTable
from superset.models.slice import Slice
from superset.utils.core import backend, get_example_default_schema
from tests.integration_tests.fixtures.birth_names_dashboard import (
load_birth_names_dashboard_with_slices,
load_birth_names_data,
Expand All @@ -37,6 +38,9 @@

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_fix_schema_perm():
if backend() == "sqlite":
return

dataset = db.session.query(SqlaTable).filter_by(table_name="birth_names").one()
chart = db.session.query(Slice).filter_by(slice_name="Girls").one()
dataset.schema_perm = "wrong"
Expand All @@ -45,8 +49,8 @@ def test_fix_schema_perm():

fix_datasets_schema_perm(db.session)
db.session.commit()
assert dataset.schema_perm == "[examples].[public]"
assert dataset.schema_perm == f"[examples].[{get_example_default_schema()}]"

fix_charts_schema_perm(db.session)
db.session.commit()
assert chart.schema_perm == "[examples].[public]"
assert chart.schema_perm == f"[examples].[{get_example_default_schema()}]"

0 comments on commit af8fefc

Please sign in to comment.