'User can\'t move a plugin if he
does not have change permissions on the Page model,
does not have change permissions on the plugin model
and/or does not have global change permissions.'

def test_user_cant_move_plugin(self):

    page = self.get_permissions_test_page()
    staff_user = self.get_staff_user_with_no_permissions()
    plugin = self._add_plugin_to_page(page)
    endpoint = self.get_move_plugin_uri(plugin)
    source_placeholder = plugin.placeholder
    target_placeholder = page.placeholders.get(slot='right-column')
    data = {'plugin_id': plugin.pk, 'placeholder_id': target_placeholder.pk, 'plugin_parent': ''}
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'change_link')
    self.add_global_permission(staff_user, can_change=False)
    with self.login_user_context(staff_user):
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertFalse(target_placeholder.get_plugins('en').filter(pk=plugin.pk))
        self.assertTrue(source_placeholder.get_plugins('en').filter(pk=plugin.pk))
