eschutho commented on a change in pull request #15849:
URL: https://github.com/apache/superset/pull/15849#discussion_r677613512
##########
File path: tests/integration_tests/reports/api_tests.py
##########
@@ -674,6 +676,61 @@ def test_create_report_schedule_schema(self):
rv = self.client.post(uri, json=report_schedule_data)
assert rv.status_code == 201
+ # Test that report cannot be created with null timezone
+ report_schedule_data = {
+ "type": ReportScheduleType.ALERT,
+ "name": "new5",
+ "description": "description",
+ "creation_method": ReportCreationMethodType.ALERTS_REPORTS,
+ "crontab": "0 9 * * *",
+ "recipients": [
+ {
+ "type": ReportRecipientType.EMAIL,
+ "recipient_config_json": {"target": "[email protected]"},
+ },
+ {
+ "type": ReportRecipientType.SLACK,
+ "recipient_config_json": {"target": "channel"},
+ },
+ ],
+ "working_timeout": 3600,
+ "timezone": None,
+ "dashboard": dashboard.id,
+ "database": example_db.id,
+ }
+ rv = self.client.post(uri, json=report_schedule_data)
+ assert rv.status_code == 400
+ data = json.loads(rv.data.decode("utf-8"))
+ assert data == {"message": {"timezone": ["Field may not be null."]}}
Review comment:
do you think because it's a negative assertion instead of the positive
ones?
--
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]