'Enable plugin or Test plugin'

def post(self, request, project, plugin_id):

    plugin = self._get_plugin(plugin_id)
    if (request.DATA.get('test') and plugin.is_testable()):
        try:
            test_results = plugin.test_configuration(project)
        except Exception as exc:
            if isinstance(exc, HTTPError):
                test_results = ('%s\n%s' % (exc, exc.response.text[:256]))
            elif (hasattr(exc, 'read') and callable(exc.read)):
                test_results = ('%s\n%s' % (exc, exc.read()[:256]))
            else:
                logging.exception('Plugin(%s)    raised    an    error    during    test', plugin_id)
                test_results = 'There    was    an    internal    error    with    the    Plugin'
        if (not test_results):
            test_results = 'No    errors    returned'
        return Response({'detail': test_results}, status=200)
    if (not plugin.can_disable):
        return Response({'detail': ERR_ALWAYS_ENABLED}, status=400)
    plugin.enable(project)
    return Response(status=201)
