'User can\'t copy all plugins to another language if he does have
change permissions on the Page model, does not have add permissions
on the plugins being copied and/or does not have global
change permissions.'

def test_user_cant_copy_plugins_to_language(self):

    page = self._permissions_page
    staff_user = self.get_staff_user_with_no_permissions()
    translation = self._add_translation_to_page(page)
    endpoint = self.get_admin_url(Page, 'copy_language', page.pk)
    plugins = [self._add_plugin_to_page(page), self._add_plugin_to_page(page), self._add_plugin_to_page(page), self._add_plugin_to_page(page)]
    placeholder = plugins[0].placeholder
    data = {'source_language': 'en', 'target_language': translation.language}
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'add_link')
    self.add_page_permission(staff_user, page, can_change=False)
    with self.login_user_context(staff_user):
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        new_plugins = placeholder.get_plugins(translation.language)
        self.assertEqual(new_plugins.count(), 0)
