docstr: SavedQuery API: Test get saved queries favorite filter
code: def test_get_saved_query_favorite_filter(self):
      """
      SavedQuery API: Test get saved queries favorite filter
      """
      admin = self.get_user("admin")
      users_favorite_query = db.session.query(FavStar.obj_id).filter(
          and_(
              FavStar.user_id == admin.id, FavStar.class_name == "query"
          )
      )
      expected_models = (
          db.session.query(SavedQuery)
          .filter(and_(SavedQuery.id.in_(users_favorite_query)))
          .order_by(SavedQuery.label.asc())
          .all()
      )
  
      arguments = {
          "filters": [
              {"col": "id", "opr": "saved_query_is_fav", "value": True}
          ],
          "order_column": "label",
          "order_direction": "asc",
          "keys": ["none"],
          "columns": ["label"],
      }
      self.login(username="admin")
      uri = f"api/v1/saved_query/?q={prison.dumps(arguments)}"
      rv = self.client.get(uri)
      data = json.loads(rv.data.decode("utf-8"))
      assert rv.status_code == 200
      assert len(expected_models) == data["count"]
  
      for i, expected_model in enumerate(expected_models):
          assert expected_model.label == data["result"][i]["label"]
  
      # Test not favorite saves queries
      expected_models = (
          db.session.query(SavedQuery)
          .filter(
              and_(
                  ~SavedQuery.id.in_(users_favorite_query),
                  SavedQuery.created_by == admin,
              )
          )
          .order_by(SavedQuery.label.asc())
          .all()
      )
      arguments["filters"][0]["value"] = False
      uri = f"api/v1/saved_query/?q={prison.dumps(arguments)}"
      rv = self.client.get(uri)
      data = json.loads(rv.data.decode("utf-8"))
      assert rv.status_code == 200
      assert len(expected_models) == data["count"]
  
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 14 for calling the TestSavedQueryApi obj's underlying member method code with example usage: obj.test_get_saved_query_favorite_filter() without return types