'User can\'t add a new plugin if he does not have
change permissions on the model attached to the placeholder
and/or does not have add permissions on the plugin model.'

def test_user_cant_add_plugin(self):

    staff_user = self._staff_user
    placeholder = self._obj.placeholder
    plugins = placeholder.get_plugins('en').filter(plugin_type='LinkPlugin')
    endpoint = self._get_add_plugin_uri()
    self.add_permission(staff_user, 'add_example1')
    self.add_permission(staff_user, 'delete_example1')
    self.add_permission(staff_user, 'add_link')
    with self.login_user_context(staff_user):
        data = {'name': 'A    Link', 'external_link': 'https://www.django-cms.org'}
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertEqual(plugins.count(), 0)
    self.add_permission(staff_user, 'change_example1')
    self.remove_permission(staff_user, 'add_link')
    with self.login_user_context(staff_user):
        data = {'name': 'A    Link', 'external_link': 'https://www.django-cms.org'}
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertEqual(plugins.count(), 0)
