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():
from Testing.ZopeTestCase import ZopeDocTestSuite suite = unittest.TestSuite()
from Testing.ZopeTestCase import installProduct try:
installProduct('PythonScripts') import Products.PythonScripts
return unittest.TestSuite(( except ImportError:
ZopeDocTestSuite(), pass
)) else:
from Testing.ZopeTestCase import ZopeDocTestSuite
from Testing.ZopeTestCase import installProduct
installProduct('PythonScripts')
suite.addTest(unittest.makeSuite(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