Commit f23cee5b authored by Hanno Schlichting's avatar Hanno Schlichting

Made the tests conditional on the presence of PythonScripts

parent 7b17b903
import unittest import unittest
from AccessControl import Unauthorized from AccessControl import Unauthorized
from Products.PythonScripts.PythonScript import manage_addPythonScript
def addPythonScript(folder, id, params='', body=''): def addPythonScript(folder, id, params='', body=''):
"""Add a PythonScript to folder.""" """Add a PythonScript to folder."""
from Products.PythonScripts.PythonScript import manage_addPythonScript
# clean up any 'ps' that's already here.. # clean up any 'ps' that's already here..
if id in folder: if id in folder:
del folder[id] del folder[id]
...@@ -179,9 +179,14 @@ def test_view_restricted_code(): ...@@ -179,9 +179,14 @@ def test_view_restricted_code():
def test_suite(): def test_suite():
suite = unittest.TestSuite()
try:
import Products.PythonScripts
except ImportError:
pass
else:
from Testing.ZopeTestCase import ZopeDocTestSuite from Testing.ZopeTestCase import ZopeDocTestSuite
from Testing.ZopeTestCase import installProduct from Testing.ZopeTestCase import installProduct
installProduct('PythonScripts') installProduct('PythonScripts')
return unittest.TestSuite(( suite.addTest(unittest.makeSuite(ZopeDocTestSuite()))
ZopeDocTestSuite(), return suite
))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment