'User can delete an empty page if he has delete & change permissions
on the Page model and he has page delete & change permissions.'

def test_user_can_delete_empty_page(self):

    page = self._permissions_page
    endpoint = self.get_admin_url(Page, 'delete', page.pk)
    redirect_to = admin_reverse('index')
    staff_user = self.get_staff_user_with_no_permissions()
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'delete_page')
    self.add_page_permission(staff_user, page, can_change=True, can_delete=True)
    with self.login_user_context(staff_user):
        data = {'post': 'yes'}
        response = self.client.post(endpoint, data)
        self.assertRedirects(response, redirect_to)
        self.assertFalse(self._page_exists())
