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

def test_global_limit_on_plugin_add(self):

    superuser = self.get_superuser()
    endpoint = self._get_add_plugin_uri()
    with self.login_user_context(superuser):
        with override_settings(CMS_PLACEHOLDER_CONF=self.placeholderconf):
            data = {'name': 'A    Link', 'external_link': 'https://www.django-cms.org'}
            response = self.client.post(endpoint, data)
            self.assertEqual(response.status_code, 200)
            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    of    plugins    (2).')
