def METHOD_NAME(flask_client):
    """Different scenarios with pinned alias"""
    user = create_new_user()
    # to have 3 pages: 2*PAGE_LIMIT + the alias automatically created for a new account
    for _ in range(2 * PAGE_LIMIT):
        Alias.create_new_random(user)
    first_alias = Alias.filter_by(user_id=user.id).order_by(Alias.id).first()
    # should return PAGE_LIMIT alias
    alias_infos = get_alias_infos_with_pagination_v3(user)
    assert len(alias_infos) == PAGE_LIMIT
    # make sure first_alias is not returned as the default order is alias creation date
    assert first_alias not in [ai.alias for ai in alias_infos]
    # pin the first alias
    first_alias.pinned = True
    Session.commit()
    alias_infos = get_alias_infos_with_pagination_v3(user)
    # now first_alias is the first result
    assert first_alias == alias_infos[0].alias
    # and the page size is still the same
    assert len(alias_infos) == PAGE_LIMIT
    # pinned alias isn't included in the search
    alias_infos = get_alias_infos_with_pagination_v3(user, query="no match")
    assert len(alias_infos) == 0