docstr: Test that a dashboard can be imported multiple times
docstr_tok: ["Test","that","a","dashboard","can","be","imported","multiple","times"]
code: def test_import_v1_dashboard_multiple(self, mock_g):
      """Test that a dashboard can be imported multiple times"""
      mock_g.user = security_manager.find_user("admin")
  
      num_dashboards = db.session.query(Dashboard).count()
  
      contents = {
          "metadata.yaml": yaml.safe_dump(dashboard_metadata_config),
          "databases/imported_database.yaml": yaml.safe_dump(
              database_config
          ),
          "datasets/imported_dataset.yaml": yaml.safe_dump(
              dataset_config
          ),
          "charts/imported_chart.yaml": yaml.safe_dump(chart_config),
          "dashboards/imported_dashboard.yaml": yaml.safe_dump(
              dashboard_config
          ),
      }
      command = v1.ImportDashboardsCommand(contents, overwrite=True)
      command.run()
      command.run()
  
      new_num_dashboards = db.session.query(Dashboard).count()
      assert new_num_dashboards == num_dashboards + 1
  
      dashboard = (
          db.session.query(Dashboard)
          .filter_by(uuid=dashboard_config["uuid"])
          .one()
      )
      chart = dashboard.slices[0]
      dataset = chart.table
      database = dataset.database
  
      db.session.delete(dashboard)
      db.session.delete(chart)
      db.session.delete(dataset)
      db.session.delete(database)
      db.session.commit()
  
imports: import itertools
  import json
  from unittest.mock import MagicMock, patch
  import pytest
  import yaml
  from werkzeug.utils import secure_filename
  from superset import db, security_manager
  from superset.commands.dashboard.exceptions import DashboardNotFoundError
  from superset.commands.dashboard.export import append_charts, ExportDashboardsCommand, get_default_position
  from superset.commands.dashboard.importers import v0, v1
  from superset.commands.exceptions import CommandInvalidError
  from superset.commands.importers.exceptions import IncorrectVersionError
  from superset.connectors.sqla.models import SqlaTable
  from superset.models.core import Database
  from superset.models.dashboard import Dashboard
  from superset.models.slice import Slice
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.fixtures.importexport import chart_config, dashboard_config, dashboard_export, dashboard_metadata_config, database_config, dataset_config, dataset_metadata_config
  from tests.integration_tests.fixtures.world_bank_dashboard import load_world_bank_dashboard_with_slices, load_world_bank_data
label_desc: Use image node_id 3 for calling the TestImportDashboardsCommand obj's underlying member method code with example usage: obj.test_import_v1_dashboard_multiple(mock_g) without return types