class_docstr: Testing export import functionality for dashboards
class_docstr_tok: ["Testing","export","import","functionality","for","dashboards"]
code: def test_export_1_dashboard(self):
      self.login("admin")
      birth_dash = self.get_dash_by_slug("births")
      id_ = birth_dash.id
      export_dash_url = (
          f"/dashboard/export_dashboards_form?id={id_}&action=go"
      )
      resp = self.client.get(export_dash_url)
      exported_dashboards = json.loads(
          resp.data.decode("utf-8"), object_hook=decode_dashboards
      )["dashboards"]
  
      birth_dash = self.get_dash_by_slug("births")
      self.assert_only_exported_slc_fields(
          birth_dash, exported_dashboards[0]
      )
      self.assert_dash_equals(birth_dash, exported_dashboards[0])
      self.assertEqual(
          id_,
          json.loads(
              exported_dashboards[0].json_metadata,
              object_hook=decode_dashboards,
          )["remote_id"],
      )
  
      exported_tables = json.loads(
          resp.data.decode("utf-8"), object_hook=decode_dashboards
      )["datasources"]
      self.assertEqual(1, len(exported_tables))
      self.assert_table_equals(
          self.get_table(name="birth_names"), exported_tables[0]
      )
  
imports: import json
  import unittest
  from tests.integration_tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices, load_birth_names_data
  import pytest
  from flask import g
  from sqlalchemy.orm.session import make_transient
  from tests.integration_tests.fixtures.energy_dashboard import load_energy_table_with_slice, load_energy_table_data
  from tests.integration_tests.test_app import app
  from superset.commands.dashboard.importers.v0 import decode_dashboards
  from superset import db, security_manager
  from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
  from superset.commands.dashboard.importers.v0 import import_chart, import_dashboard
  from superset.commands.dataset.importers.v0 import import_dataset
  from superset.models.dashboard import Dashboard
  from superset.models.slice import Slice
  from superset.utils.core import DatasourceType, get_example_default_schema
  from superset.utils.database import get_example_database
  from tests.integration_tests.fixtures.world_bank_dashboard import load_world_bank_dashboard_with_slices, load_world_bank_data
  from .base_tests import SupersetTestCase
label_desc: Use image node_id 12 for calling the TestImportExport obj's underlying member method code with example usage: obj.test_export_1_dashboard() without return types