Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix deprecated unittest aliases. #19042

Merged
merged 1 commit into from
Mar 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)