Ignore certain lines for code coverage.
svn path=/plone.app.discussion/trunk/; revision=40082
This commit is contained in:
parent
aeabd6fc11
commit
cbde125048
@ -34,7 +34,7 @@ def patchedClearFindAndRebuild(self):
|
||||
comment = comment.__of__(conversation)
|
||||
if catalog:
|
||||
catalog.indexObject(comment)
|
||||
except StopIteration:
|
||||
except StopIteration: # pragma: no cover
|
||||
pass
|
||||
|
||||
except TypeError:
|
||||
|
@ -13,6 +13,7 @@ from interfaces import ICommentingTool, IComment
|
||||
from Products.CMFCore.utils import UniqueObject, getToolByName
|
||||
from OFS.SimpleItem import SimpleItem
|
||||
|
||||
|
||||
class CommentingTool(UniqueObject, SimpleItem):
|
||||
|
||||
interface.implements(ICommentingTool)
|
||||
|
@ -7,28 +7,28 @@ from plone.app.discussion.interfaces import _
|
||||
HAS_CAPTCHA = False
|
||||
try:
|
||||
import plone.formwidget.captcha
|
||||
HAS_CAPTCHA = True
|
||||
HAS_CAPTCHA = True # pragma: no cover
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
HAS_RECAPTCHA = False
|
||||
try:
|
||||
import plone.formwidget.recaptcha
|
||||
HAS_RECAPTCHA = True
|
||||
HAS_RECAPTCHA = True # pragma: no cover
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
HAS_AKISMET = False
|
||||
try:
|
||||
import collective.akismet
|
||||
HAS_AKISMET = True
|
||||
HAS_AKISMET = True # pragma: no cover
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
HAS_NOROBOTS = False
|
||||
try:
|
||||
import collective.z3cform.norobots
|
||||
HAS_NOROBOTS = True
|
||||
HAS_NOROBOTS = True # pragma: no cover
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@ -43,36 +43,35 @@ def captcha_vocabulary(context):
|
||||
token='disabled',
|
||||
title=_(u'Disabled')))
|
||||
|
||||
if HAS_CAPTCHA:
|
||||
if HAS_CAPTCHA: # pragma: no cover
|
||||
terms.append(
|
||||
SimpleTerm(
|
||||
value='captcha',
|
||||
token='captcha',
|
||||
title='Captcha'))
|
||||
if HAS_RECAPTCHA:
|
||||
|
||||
if HAS_RECAPTCHA: # pragma: no cover
|
||||
terms.append(
|
||||
SimpleTerm(
|
||||
value='recaptcha',
|
||||
token='recaptcha',
|
||||
title='ReCaptcha'))
|
||||
if HAS_AKISMET:
|
||||
title='ReCaptcha'))
|
||||
|
||||
if HAS_AKISMET: # pragma: no cover
|
||||
terms.append(
|
||||
SimpleTerm(
|
||||
value='akismet',
|
||||
token='akismet',
|
||||
title='Akismet'))
|
||||
|
||||
|
||||
if HAS_NOROBOTS:
|
||||
terms.append(
|
||||
title='Akismet'))
|
||||
|
||||
if HAS_NOROBOTS: # pragma: no cover
|
||||
terms.append(
|
||||
SimpleTerm(
|
||||
value='norobots',
|
||||
token='norobots',
|
||||
title='Norobots'))
|
||||
|
||||
return SimpleVocabulary(terms)
|
||||
|
||||
|
||||
def text_transform_vocabulary(context):
|
||||
"""Vocabulary with all available portal_transform transformations.
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user