code: def test_import_variables_failed(session, admin_client):
      content = '{"str_key": "str_value"}'
  
      with mock.patch("airflow.models.Variable.set") as set_mock:
          set_mock.side_effect = UnicodeEncodeError
          assert session.query(Variable).count() == 0
  
          bytes_content = BytesIO(bytes(content, encoding="utf-8"))
  
          resp = admin_client.post(
              "/variable/varimport",
              data={"file": (bytes_content, "test.json")},
              follow_redirects=True,
          )
          check_content_in_response(
              "1 variable(s) failed to be updated.", resp
          )
  
imports: from __future__ import annotations
  from io import BytesIO
  from unittest import mock
  import pytest
  from airflow.models import Variable
  from airflow.security import permissions
  from airflow.utils.session import create_session
  from tests.test_utils.api_connexion_utils import create_user
  from tests.test_utils.www import _check_last_log, check_content_in_response, check_content_not_in_response, client_with_login
label_desc: Use image node_id 7 for calling a global function with example usage: test_import_variables_failed(session, admin_client) without return types