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

def test_type_limit_on_plugin_add(self):

    superuser = self.get_superuser()
    endpoint = self._get_add_plugin_uri('StylePlugin')
    with self.login_user_context(superuser):
        with self.settings(CMS_PLACEHOLDER_CONF=self.placeholderconf):
            data = {'tag_type': 'div'}
            response = self.client.post(endpoint, data)
            self.assertEqual(response.status_code, 200)
            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.')
