'User can add a new plugin if he has change permissions
on the model attached to the placeholder and he has
add permissions on the plugin model.'

def test_user_can_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, 'change_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, 200)
        self.assertEqual(plugins.count(), 1)
