benjreinhart commented on a change in pull request #14684:
URL: https://github.com/apache/superset/pull/14684#discussion_r636493722
##########
File path: tests/alerts_tests.py
##########
@@ -359,3 +364,47 @@ def test_deliver_alert_screenshot(
"|*Explore in Superset*>",
"title": f"[Alert] {alert.label}",
}
+
+
+class TestAlertsEndpoints(SupersetTestCase):
+ def test_log_model_view_disabled(self):
+ with patch.object(AlertLogModelView, "is_enabled", return_value=False):
+ self.login("admin")
+ uri = "/alertlogmodelview/list/"
+ rv = self.client.get(uri)
+ self.assertEqual(rv.status_code, 404)
+
+ def test_log_model_view_enabled(self):
+ with patch.object(AlertLogModelView, "is_enabled", return_value=True):
+ self.login("admin")
+ uri = "/alertlogmodelview/list/"
+ rv = self.client.get(uri)
+ self.assertNotEqual(rv.status_code, 404)
Review comment:
Yes I agree, unfortunately many of these return 302s since I believe
more setup is required to get the right users access to the resources. Ideally,
these tests would do that, but seeing as I wasn't able to resolve it right
away, I wanted to get this PR out and also keep the changes to a minimum.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]