Make sure no left-overs exist in the test environment before testing...

Make sure no left-overs exist in the test environment before testing transactional behaviour of the ClassTool filesystem manipulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29874 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2040c916
...@@ -30,6 +30,7 @@ from Testing import ZopeTestCase ...@@ -30,6 +30,7 @@ from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.utils import installRealClassTool from Products.ERP5Type.tests.utils import installRealClassTool
from App.config import getConfiguration
from zLOG import LOG from zLOG import LOG
try: try:
...@@ -84,6 +85,11 @@ class TestClassTool(ERP5TypeTestCase): ...@@ -84,6 +85,11 @@ class TestClassTool(ERP5TypeTestCase):
portal = self.getPortal() portal = self.getPortal()
portal_classes = portal.portal_classes portal_classes = portal.portal_classes
self.assertEqual(portal_classes.getLocalDocumentList(), [],
'Test environment is dirty. Please clean up the instance home of '
'the test environment and fix up tests that might have left over '
'files at %s' % getConfiguration().instancehome
)
portal_classes.newDocument('Toto') portal_classes.newDocument('Toto')
get_transaction().abort() get_transaction().abort()
self.assertNotEqual(portal_classes.getLocalDocumentList(), ['Toto']) self.assertNotEqual(portal_classes.getLocalDocumentList(), ['Toto'])
......
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