dpgaspar commented on code in PR #21515:
URL: https://github.com/apache/superset/pull/21515#discussion_r977568600
##########
tests/integration_tests/base_api_tests.py:
##########
@@ -288,6 +288,30 @@ def test_get_filter_related_owners(self):
# TODO Check me
assert expected_results == sorted_results
+ def test_get_base_filter_related_owners(self):
+ """
+ API: Test get base filter related owners
+ """
+ self.login(username="admin")
+ uri = f"api/v1/{self.resource_name}/related/owners"
+ self.app.config["EXCLUDE_USER_USERNAMES"] = ["gamma"]
+ gamma_user = (
+ db.session.query(security_manager.user_model)
+ .filter(security_manager.user_model.username == "gamma")
+ .one_or_none()
+ )
+ assert gamma_user is not None
+ users = db.session.query(security_manager.user_model).all()
+
+ rv = self.client.get(uri)
+ assert rv.status_code == 200
+ response = json.loads(rv.data.decode("utf-8"))
+ assert response["count"] == len(users) - 1
+ response_users = [result["text"] for result in response["result"]]
+ assert "gamma user" not in response_users
+ # revert the config change
+ self.app.config["EXCLUDE_USER_USERNAMES"] = []
Review Comment:
yes, implemented a `with_config` decorator per @villebro sugestion
--
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]