'Converts data created by get_new_page_data_dbfields to data
created from get_new_page_data so you can switch between test cases
in api.create_page and client.post'

def get_pagedata_from_dbfields(self, page_data):

    page_data['site'] = page_data['site'].id
    page_data['parent'] = (page_data['parent'].id if page_data['parent'] else '')
    page_data['pagepermission_set-TOTAL_FORMS'] = 0
    page_data['pagepermission_set-INITIAL_FORMS'] = 0
    page_data['pagepermission_set-MAX_NUM_FORMS'] = 0
    page_data['pagepermission_set-2-TOTAL_FORMS'] = 0
    page_data['pagepermission_set-2-INITIAL_FORMS'] = 0
    page_data['pagepermission_set-2-MAX_NUM_FORMS'] = 0
    return page_data
