'Ensures placeholder plugin type limit is respected
when moving plugins to the placeholder.'

def test_type_limit_on_plugin_move(self):

    superuser = self.get_superuser()
    source_placeholder = self._obj.placeholder
    target_placeholder = self._get_example_obj().placeholder
    plugin_1 = self._add_plugin_to_placeholder(source_placeholder, 'StylePlugin')
    plugin_2 = self._add_plugin_to_placeholder(source_placeholder, 'StylePlugin')
    with self.login_user_context(superuser):
        with self.settings(CMS_PLACEHOLDER_CONF=self.placeholderconf):
            data = {'plugin_id': plugin_1.pk, 'placeholder_id': target_placeholder.pk, 'plugin_parent': ''}
            endpoint = self.get_move_plugin_uri(plugin_1, container=Example1)
            response = self.client.post(endpoint, data)
            self.assertEqual(response.status_code, 200)
            data = {'plugin_id': plugin_2.pk, 'placeholder_id': target_placeholder.pk, 'plugin_parent': ''}
            endpoint = self.get_move_plugin_uri(plugin_2, container=Example1)
            response = self.client.post(endpoint, data)
            self.assertEqual(response.status_code, 400)
            self.assertEqual(response.content, 'This    placeholder    already    has    the    maximum    number    (1)    of    allowed    Style    plugins.')
