def METHOD_NAME(
    staff_api_client,
    product_type,
    permission_manage_product_types_and_attributes,
    plugin_configuration,
    monkeypatch,
):
    # given
    plugin_configuration()
    tax_code = "P0000000"
    monkeypatch.setattr(
        "saleor.plugins.avatax.plugin.get_cached_tax_codes_or_fetch",
        lambda _: {tax_code: "desc"},
    )
    variables = {
        "id": graphene.Node.to_global_id("ProductType", product_type.pk),
        "taxCode": tax_code,
    }
    # when
    response = staff_api_client.post_graphql(
        PRODUCT_TYPE_UPDATE_MUTATION_TAX_CODE,
        variables,
        permissions=[permission_manage_product_types_and_attributes],
    )
    # then
    content = get_graphql_content(response)
    product_type.refresh_from_db()
    tax_class = product_type.tax_class
    assert tax_class
    assert tax_class.metadata["avatax.code"] == tax_code
    assert content["data"]["productTypeUpdate"]["productType"]["taxClass"][
        "id"
    ] == graphene.Node.to_global_id("TaxClass", tax_class.pk)