class_docstr: Testing export import functionality for dashboards
class_docstr_tok: ["Testing","export","import","functionality","for","dashboards"]
code: def test_export_datasource_ui_cli(self):
      # TODO(bkyryliuk): find fake db is leaking from
      self.delete_fake_db()
  
      cli_export = export_to_dict(
          session=db.session,
          recursive=True,
          back_references=False,
          include_defaults=False,
      )
      self.get_resp(
          "/login/", data=dict(username="admin", password="general")
      )
      resp = self.get_resp(
          "/databaseview/action_post",
          {"action": "yaml_export", "rowid": 1},
      )
      ui_export = yaml.safe_load(resp)
      self.assertEqual(
          ui_export["databases"][0]["database_name"],
          cli_export["databases"][0]["database_name"],
      )
      self.assertEqual(
          ui_export["databases"][0]["tables"],
          cli_export["databases"][0]["tables"],
      )
  
imports: import json
  import unittest
  from uuid import uuid4
  import yaml
  from tests.integration_tests.test_app import app
  from superset import db
  from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
  from superset.utils.database import get_example_database
  from superset.utils.dict_import_export import export_to_dict
  from .base_tests import SupersetTestCase
label_desc: Use image node_id 14 for calling the TestDictImportExport obj's underlying member method code with example usage: obj.test_export_datasource_ui_cli() without return types