Skip to content

Commit

Permalink
chore: Fix deprecated unittest aliases. (#19042)
Browse files Browse the repository at this point in the history
(cherry picked from commit 864bafc)
  • Loading branch information
tirkarthi authored and villebro committed Apr 3, 2022
1 parent fb5d77e commit 585b032
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/integration_tests/security/row_level_security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def test_rls_filter_alters_query(self):
tbl = self.get_table(name="birth_names")
sql = tbl.get_query_str(self.query_obj)

self.assertRegexpMatches(sql, RLS_ALICE_REGEX)
self.assertRegex(sql, RLS_ALICE_REGEX)

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_rls_filter_does_not_alter_unrelated_query(self):
Expand All @@ -271,7 +271,7 @@ def test_rls_filter_does_not_alter_unrelated_query(self):
tbl = self.get_table(name="birth_names")
sql = tbl.get_query_str(self.query_obj)

self.assertNotRegexpMatches(sql, RLS_ALICE_REGEX)
self.assertNotRegex(sql, RLS_ALICE_REGEX)

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_multiple_rls_filters_are_unionized(self):
Expand All @@ -287,8 +287,8 @@ def test_multiple_rls_filters_are_unionized(self):
tbl = self.get_table(name="birth_names")
sql = tbl.get_query_str(self.query_obj)

self.assertRegexpMatches(sql, RLS_ALICE_REGEX)
self.assertRegexpMatches(sql, RLS_GENDER_REGEX)
self.assertRegex(sql, RLS_ALICE_REGEX)
self.assertRegex(sql, RLS_GENDER_REGEX)

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@pytest.mark.usefixtures("load_energy_table_with_slice")
Expand All @@ -301,8 +301,8 @@ def test_rls_filter_for_all_datasets(self):
births_sql = births.get_query_str(self.query_obj)
energy_sql = energy.get_query_str(self.query_obj)

self.assertRegexpMatches(births_sql, RLS_ALICE_REGEX)
self.assertRegexpMatches(energy_sql, RLS_ALICE_REGEX)
self.assertRegex(births_sql, RLS_ALICE_REGEX)
self.assertRegex(energy_sql, RLS_ALICE_REGEX)

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_dataset_id_can_be_string(self):
Expand All @@ -313,4 +313,4 @@ def test_dataset_id_can_be_string(self):
)
sql = dataset.get_query_str(self.query_obj)

self.assertRegexpMatches(sql, RLS_ALICE_REGEX)
self.assertRegex(sql, RLS_ALICE_REGEX)

0 comments on commit 585b032

Please sign in to comment.