'User can\'t delete an empty translation if he does not
have delete permissions on the Page model and/or
does not have global delete permissions.'

def test_user_cant_delete_empty_translation(self):

    page = self.get_permissions_test_page()
    endpoint = self.get_admin_url(Page, 'delete_translation', page.pk)
    staff_user = self.get_staff_user_with_no_permissions()
    translation = self._add_translation_to_page(page)
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'delete_page')
    gp = self.add_global_permission(staff_user, can_change=True, can_delete=False)
    with self.login_user_context(staff_user):
        data = {'language': translation.language}
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertTrue(self._translation_exists())
    self.remove_permission(staff_user, 'delete_page')
    gp.can_delete = True
    gp.save(update_fields=['can_delete'])
    with self.login_user_context(staff_user):
        data = {'language': translation.language}
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertTrue(self._translation_exists())
