def posting(client, route, title_field='test title', content_field='test body',
            is_page=False, categories_field_0='', categories_field_1='',
            categories_field_2='', publish='yes', preview=None):
    """Helper function to create/edit posts and drafts by posting to our
    routes.

    This helper function also works for pages.

    Parameters
    ----------
    client : test client object
        Passed here is the flask test client used to send the request.
    route : str
        The route to where our request is going to be sent.
    title_field : str
        Post title passed to our form.
    content_field : str
        Post content passed to our form.
    is_page: bool
        Is the posting for a post or a page?
    categories_field_x : str
        Name of the categories passed to our form. A maximum of 3 are accepted.
        Their corresponding parameters are suffixed with a number from 0 to 2.
    publish : str
        Whether the post will be published or saved as a draft. This
        parameter represent the checkbox in our form. Using a string means
        the checkbox is ticked. Using an empty string means it is not checked.
    preview : str
        If a string is passed using this parameter our route is going to
        redirect us to the /preview route.

    Return
    -------
    post request object
        The test client is instructed to send a post request to a given
        route. The request contains the fields values to be posted by the form.
    """
    return client.post(route, data={
        'title_field': title_field,
        'content_field': content_field,
        'publish': publish,
        'is_page': is_page,
        'categories_field-0': categories_field_0,
        'categories_field-1': categories_field_1,
        'categories_field-2': categories_field_2,
        'preview': preview
    },
                            follow_redirects=True)