villebro commented on code in PR #21765:
URL: https://github.com/apache/superset/pull/21765#discussion_r994630958
##########
tests/integration_tests/reports/api_tests.py:
##########
@@ -52,17 +53,67 @@
class TestReportSchedulesApi(SupersetTestCase):
@pytest.fixture()
- def create_working_report_schedule(self):
+ def create_working_admin_report_schedule(self):
with self.create_app().app_context():
admin_user = self.get_user("admin")
Review Comment:
For some reason I'm having trouble using these fixtures with the class-based
tests. Let's leave this for a follow-up refactor PR when these tests are
refactored into functional tests.
##########
tests/integration_tests/reports/api_tests.py:
##########
@@ -52,17 +53,67 @@
class TestReportSchedulesApi(SupersetTestCase):
@pytest.fixture()
- def create_working_report_schedule(self):
+ def create_working_admin_report_schedule(self):
with self.create_app().app_context():
admin_user = self.get_user("admin")
+ chart = db.session.query(Slice).first()
+ example_db = get_example_database()
+
+ report_schedule = insert_report_schedule(
+ type=ReportScheduleType.ALERT,
+ name="name_admin_working",
+ crontab="* * * * *",
+ sql="SELECT value from table",
+ description="Report working",
+ chart=chart,
+ database=example_db,
+ owners=[admin_user],
+ last_state=ReportState.WORKING,
+ )
+
+ yield
+
+ db.session.delete(report_schedule)
+ db.session.commit()
+
+ @pytest.fixture()
+ def create_working_alpha_report_schedule(self):
+ with self.create_app().app_context():
+
alpha_user = self.get_user("alpha")
Review Comment:
Same here
--
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]