'User can paste plugins from the clipboard if he has
change permissions on the model attached to the target
placeholder and he has add permissions on the plugin models
being copied.'

def test_user_can_paste_from_clipboard(self):

    staff_user = self._staff_user
    target_placeholder = self._obj.placeholder
    self.add_permission(staff_user, 'change_example1')
    self.add_permission(staff_user, 'add_link')
    user_settings = UserSettings.objects.create(language='en', user=staff_user, clipboard=Placeholder.objects.create())
    placeholder_plugin = self._add_plugin_to_placeholder(user_settings.clipboard, 'PlaceholderPlugin')
    ref_placeholder = placeholder_plugin.placeholder_ref
    self._add_plugin_to_placeholder(ref_placeholder)
    self._add_plugin_to_placeholder(ref_placeholder)
    with self.login_user_context(staff_user):
        data = {'placeholder_id': target_placeholder.pk, 'plugin_id': placeholder_plugin.pk, 'plugin_parent': '', 'plugin_language': 'fr', 'plugin_order[]': '__COPY__', 'move_a_copy': True}
        endpoint = self.get_move_plugin_uri(placeholder_plugin, container=Example1)
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(target_placeholder.get_plugins('fr').count(), 2)
