docstr: ReportSchedule Api: Test get report schedule
docstr_tok: ["ReportSchedule","Api",":","Test","get","report","schedule"]
code: def test_get_report_schedule(self):
      """
      ReportSchedule Api: Test get report schedule
      """
      report_schedule = (
          db.session.query(ReportSchedule)
          .filter(ReportSchedule.name == "name1")
          .first()
      )
  
      self.login(username="admin")
      uri = f"api/v1/report/{report_schedule.id}"
      rv = self.get_assert_metric(uri, "get")
      data = json.loads(rv.data.decode("utf-8"))
      assert rv.status_code == 200
      expected_result = {
          "active": report_schedule.active,
          "chart": {
              "id": report_schedule.chart.id,
              "slice_name": report_schedule.chart.slice_name,
              "viz_type": report_schedule.chart.viz_type,
          },
          "context_markdown": report_schedule.context_markdown,
          "crontab": report_schedule.crontab,
          "dashboard": None,
          "database": {
              "id": report_schedule.database.id,
              "database_name": report_schedule.database.database_name,
          },
          "description": report_schedule.description,
          "grace_period": report_schedule.grace_period,
          "id": report_schedule.id,
          "last_eval_dttm": report_schedule.last_eval_dttm,
          "last_state": report_schedule.last_state,
          "last_value": report_schedule.last_value,
          "last_value_row_json": report_schedule.last_value_row_json,
          "log_retention": report_schedule.log_retention,
          "name": report_schedule.name,
          "recipients": [
              {
                  "id": report_schedule.recipients[0].id,
                  "recipient_config_json": '{"target": "target0@email.com"}',
                  "type": "Email",
              }
          ],
          "timezone": report_schedule.timezone,
          "type": report_schedule.type,
          "validator_config_json": report_schedule.validator_config_json,
          "validator_type": report_schedule.validator_type,
      }
      for key in expected_result:
          assert data["result"][key] == expected_result[key]
      # needed because order may vary
      assert {
          "first_name": "admin",
          "id": 1,
          "last_name": "user",
      } in data["result"]["owners"]
      assert {
          "first_name": "alpha",
          "id": 5,
          "last_name": "user",
      } in data["result"]["owners"]
      assert len(data["result"]["owners"]) == 2
  
imports: from datetime import datetime
  import json
  import pytz
  import pytest
  import prison
  from parameterized import parameterized
  from sqlalchemy.sql import func
  from superset import db, security_manager
  from superset.models.core import Database
  from superset.models.slice import Slice
  from superset.models.dashboard import Dashboard
  from superset.reports.models import ReportSchedule, ReportCreationMethod, ReportRecipients, ReportExecutionLog, ReportScheduleType, ReportRecipientType, ReportState
  from superset.utils.database import get_example_database
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.conftest import with_feature_flags
  from tests.integration_tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices, load_birth_names_data
  from tests.integration_tests.reports.utils import insert_report_schedule
label_desc: Use image node_id 8 for calling the TestReportSchedulesApi obj's underlying member method code with example usage: obj.test_get_report_schedule() without return types