'User can clear a placeholder with plugins if he has
change permissions on the model attached to the placeholder
and delete permissions on the plugin model.'

def test_user_can_clear_non_empty_placeholder(self):

    staff_user = self._staff_user
    placeholder = self._obj.placeholder
    plugins = [self._add_plugin_to_placeholder(placeholder, 'StylePlugin'), self._add_plugin_to_placeholder(placeholder, 'LinkPlugin')]
    placeholder = plugins[0].placeholder
    endpoint = self.get_clear_placeholder_url(placeholder, container=Example1)
    self.add_permission(staff_user, 'delete_style')
    self.add_permission(staff_user, 'delete_link')
    self.add_permission(staff_user, 'change_example1')
    with self.login_user_context(staff_user):
        response = self.client.post(endpoint, {'test': 0})
        self.assertEqual(response.status_code, 302)
        self.assertEqual(placeholder.get_plugins('en').count(), 0)
