'Test moving the plugin from the clipboard to a placeholder.'

def test_move_and_delete_plugin_alias(self):

    page_en = api.create_page('PluginOrderPage', 'col_two.html', 'en', slug='page1', published=True, in_navigation=True)
    ph_en = page_en.placeholders.get(slot='col_left')
    text_plugin_1 = api.add_plugin(ph_en, 'TextPlugin', 'en', body="I'm    the    first")
    with self.login_user_context(self.get_superuser()):
        self.client.post(admin_reverse('cms_create_alias'), data={'plugin_id': text_plugin_1.pk})
        try:
            clipboard = Placeholder.objects.get(slot='clipboard')
        except (Placeholder.DoesNotExist, Placeholder.MultipleObjectsReturned):
            clipboard = 0
        self.assertGreater(clipboard.pk, 0)
        self.assertEqual(len(clipboard.get_plugins_list()), 1)
        alias_plugin = clipboard.get_plugins_list()[0]
        copy_endpoint = self.get_copy_plugin_uri(alias_plugin)
        response = self.client.post(copy_endpoint, data={'source_placeholder_id': clipboard.pk, 'source_plugin': alias_plugin.pk, 'source_language': 'en', 'target_placeholder_id': ph_en.pk, 'target_language': 'en'})
        self.assertEqual(response.status_code, 200)
        delete_endpoint = self.get_delete_plugin_uri(alias_plugin)
        response = self.client.post(delete_endpoint, data={})
        self.assertEqual(response.status_code, 200)
