def METHOD_NAME(
    staff_api_client, permission_manage_pages, page_type
):
    page_slug = "test-slug"
    page_content = dummy_editorjs("test content", True)
    page_title = "test title"
    page_is_published = True
    publication_date = datetime.now(pytz.utc) + timedelta(days=5)
    page_type_id = graphene.Node.to_global_id("PageType", page_type.pk)
    # Default attributes defined in product_type fixture
    tag_attr = page_type.page_attributes.get(name="tag")
    tag_value_slug = tag_attr.values.first().slug
    tag_value_name = tag_attr.values.first().name
    tag_attr_id = graphene.Node.to_global_id("Attribute", tag_attr.id)
    # Add second attribute
    size_attr = page_type.page_attributes.get(name="Page size")
    size_attr_id = graphene.Node.to_global_id("Attribute", size_attr.id)
    non_existent_attr_value = "New value"
    # test creating root page
    variables = {
        "input": {
            "title": page_title,
            "content": page_content,
            "isPublished": page_is_published,
            "publicationDate": publication_date,
            "slug": page_slug,
            "pageType": page_type_id,
            "attributes": [
                {"id": tag_attr_id, "values": [tag_value_name]},
                {"id": size_attr_id, "values": [non_existent_attr_value]},
            ],
        }
    }
    response = staff_api_client.post_graphql(
        CREATE_PAGE_MUTATION, variables, permissions=[permission_manage_pages]
    )
    content = get_graphql_content(response)
    data = content["data"]["pageCreate"]
    assert data["errors"] == []
    assert data["page"]["title"] == page_title
    assert data["page"]["content"] == page_content
    assert data["page"]["slug"] == page_slug
    assert data["page"]["isPublished"] == page_is_published
    assert data["page"]["publicationDate"] == publication_date.date().isoformat()
    assert data["page"]["pageType"]["id"] == page_type_id
    values = (
        data["page"]["attributes"][0]["values"][0]["slug"],
        data["page"]["attributes"][1]["values"][0]["slug"],
    )
    assert slugify(non_existent_attr_value) in values
    assert tag_value_slug in values