JasonD28 commented on a change in pull request #10605:
URL:
https://github.com/apache/incubator-superset/pull/10605#discussion_r478685993
##########
File path: tests/alerts_tests.py
##########
@@ -41,95 +50,204 @@
def setup_database():
with app.app_context():
slice_id = db.session.query(Slice).all()[0].id
- database_id = utils.get_example_database().id
+ database = utils.get_example_database()
+ database_id = database.id
+ database.get_sqla_engine().execute("CREATE TABLE test_table AS SELECT
2 as id")
+ common_data = dict(
+ active=True,
+ crontab="* * * * *",
+ slice_id=slice_id,
+ recipients="[email protected]",
+ slack_channel="#test_channel",
+ )
alerts = [
- Alert(
- id=1,
- label="alert_1",
- active=True,
- crontab="*/1 * * * *",
- sql="SELECT 0",
- alert_type="email",
- slice_id=slice_id,
- database_id=database_id,
+ Alert(**common_data, id=1, label="alert_1"),
Review comment:
I specified id's in order to control with SQLObserver is linked to which
alert (alert_id column in SQLObserver), I'm not sure if there is another way to
do this
----------------------------------------------------------------
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]