Remove ImportError exceptions for Plone < 4.1 code and plone.z3cform < 0.6.0.
svn path=/plone.app.discussion/trunk/; revision=49033
This commit is contained in:
@@ -5,18 +5,14 @@
|
||||
"""
|
||||
import doctest
|
||||
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
import pprint
|
||||
import unittest2 as unittest
|
||||
import pprint
|
||||
|
||||
from plone.testing import layered
|
||||
from plone.testing import layered
|
||||
|
||||
from plone.app.discussion.testing import \
|
||||
PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING
|
||||
|
||||
from plone.app.discussion.testing import \
|
||||
PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING
|
||||
PLONE4 = True
|
||||
except ImportError:
|
||||
import unittest
|
||||
PLONE4 = False
|
||||
|
||||
optionflags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | doctest.REPORT_ONLY_FIRST_FAILURE)
|
||||
normal_testfiles = [
|
||||
@@ -24,24 +20,15 @@ normal_testfiles = [
|
||||
'functional_test_comment_review_workflow.txt'
|
||||
]
|
||||
|
||||
if PLONE4:
|
||||
def test_suite():
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTests([
|
||||
layered(doctest.DocFileSuite(test ,
|
||||
optionflags=optionflags,
|
||||
globs={'pprint': pprint.pprint,
|
||||
}
|
||||
),
|
||||
layer=PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING)
|
||||
for test in normal_testfiles])
|
||||
return suite
|
||||
|
||||
def test_suite():
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTests([
|
||||
layered(doctest.DocFileSuite(test ,
|
||||
optionflags=optionflags,
|
||||
globs={'pprint': pprint.pprint,
|
||||
}
|
||||
),
|
||||
layer=PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING)
|
||||
for test in normal_testfiles])
|
||||
return suite
|
||||
|
||||
else:
|
||||
|
||||
def test_suite():
|
||||
return unittest.TestSuite([])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(defaultTest='test_suite')
|
||||
|
||||
Reference in New Issue
Block a user