def METHOD_NAME(
    user_api_client, graphql_address_data, address
):
    """Ensure that when mew address it added to user with max amount of addressess,
    the oldest address will be removed."""
    user = user_api_client.user
    same_address = Address.objects.create(**address.as_data())
    user.addresses.set([address, same_address])
    user_addresses_count = user.addresses.count()
    query = ACCOUNT_ADDRESS_CREATE_MUTATION
    mutation_name = "accountAddressCreate"
    variables = {"addressInput": graphql_address_data}
    response = user_api_client.post_graphql(query, variables)
    content = get_graphql_content(response)
    data = content["data"][mutation_name]
    assert data["address"]["city"] == graphql_address_data["city"].upper()
    user.refresh_from_db()
    assert user.addresses.count() == user_addresses_count
    with pytest.raises(address._meta.model.DoesNotExist):
        address.refresh_from_db()