sadpandajoe commented on code in PR #34192:
URL: https://github.com/apache/superset/pull/34192#discussion_r2213768277
##########
tests/integration_tests/security/row_level_security_tests.py:
##########
@@ -555,6 +555,28 @@ def test_rls_tables_related_api(self):
assert len(result) == len(db_tables)
assert db_table_names == received_tables
+ def test_rls_tables_related_api_with_filter(self):
+ self.login(ADMIN_USERNAME)
+ # Test with filter that should match 'birth_names'
+ params = prison.dumps({"filter": "birth", "page": 0, "page_size": 100})
+ rv =
self.client.get(f"/api/v1/rowlevelsecurity/related/tables?q={params}")
+ assert rv.status_code == 200
+ data = json.loads(rv.data.decode("utf-8"))
+ result = data["result"]
+ received_tables = {table["text"] for table in result}
+ # Should only return tables with 'birth' in the name
+ assert all("birth" in table_name.lower() for table_name in
received_tables)
+ assert len(result) >= 1 # At least birth_names should be returned
+
+ # Test with filter that should match nothing
Review Comment:
nit: I think I'd prefer breaking this up into a separate test such that if
there is a failure that it's pretty clear which scenario broke instead of
having to investigate if it's not returning the right item or empty is broken.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]