'User can delete a page with plugins if he has delete & change permissions
on the Page model, delete permissions on the plugins in the page
translations and global delete & change permissions.'

def test_user_can_delete_non_empty_page(self):

    page = self.get_permissions_test_page()
    endpoint = self.get_admin_url(Page, 'delete', page.pk)
    redirect_to = self.get_admin_url(Page, 'changelist')
    staff_user = self.get_staff_user_with_no_permissions()
    self._add_plugin_to_page(page)
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'delete_page')
    self.add_permission(staff_user, 'delete_link')
    self.add_global_permission(staff_user, 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())
