def METHOD_NAME(app_api_client, permission_manage_orders, order):
    # given
    test_key = "test_key"
    metadata = {test_key: "test_val"}
    invoice = Invoice.objects.create(order=order, metadata=metadata)
    number = "01/12/2020/TEST"
    url = "http://www.example.com"
    graphene_invoice_id = graphene.Node.to_global_id("Invoice", invoice.pk)
    new_metadata = [{"key": test_key, "value": "test value"}]
    private_metadata = [{"key": "private test key", "value": "private test value"}]
    variables = {
        "id": graphene_invoice_id,
        "input": {
            "number": number,
            "url": url,
            "metadata": new_metadata,
            "privateMetadata": private_metadata,
        },
    }
    # when
    response = app_api_client.post_graphql(
        INVOICE_UPDATE_MUTATION, variables, permissions=(permission_manage_orders,)
    )
    # then
    content = get_graphql_content(response)
    invoice.refresh_from_db()
    assert invoice.status == JobStatus.SUCCESS
    assert invoice.number == content["data"]["invoiceUpdate"]["invoice"]["number"]
    assert content["data"]["invoiceUpdate"]["invoice"]["metadata"] == new_metadata
    assert (
        content["data"]["invoiceUpdate"]["invoice"]["privateMetadata"]
        == private_metadata
    )
    assert invoice.url == content["data"]["invoiceUpdate"]["invoice"]["url"]
    assert content["data"]["invoiceUpdate"]["invoice"]["id"] == graphene_invoice_id