docstr: Saved Query API: Test import
code: def test_import_saved_queries(self):
      """
      Saved Query API: Test import
      """
      self.login(username="admin")
      uri = "api/v1/saved_query/import/"
  
      buf = self.create_saved_query_import()
      form_data = {
          "formData": (buf, "saved_query.zip"),
      }
      rv = self.client.post(
          uri, data=form_data, content_type="multipart/form-data"
      )
      response = json.loads(rv.data.decode("utf-8"))
  
      assert rv.status_code == 200
      assert response == {"message": "OK"}
      database = (
          db.session.query(Database)
          .filter_by(uuid=database_config["uuid"])
          .one()
      )
      assert database.database_name == "imported_database"
  
      saved_query = (
          db.session.query(SavedQuery)
          .filter_by(uuid=saved_queries_config["uuid"])
          .one()
      )
      assert saved_query.database == database
  
      db.session.delete(saved_query)
      db.session.delete(database)
      db.session.commit()
  
imports: import json
  from datetime import datetime
  from io import BytesIO
  from typing import Optional
  from zipfile import is_zipfile, ZipFile
  import yaml
  import pytest
  import prison
  from freezegun import freeze_time
  from sqlalchemy.sql import func, and_
  import tests.integration_tests.test_app
  from superset import db
  from superset.models.core import Database
  from superset.models.core import FavStar
  from superset.models.sql_lab import SavedQuery
  from superset.utils.database import get_example_database
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.fixtures.importexport import database_config, saved_queries_config, saved_queries_metadata_config
label_desc: Use image node_id 36 for calling the TestSavedQueryApi obj's underlying member method code with example usage: obj.test_import_saved_queries() without return types