Hi there,

the presence of a intid-utility gives a strange behavior when adding other objects to a zope3 container.
(test attached)

Cheers,
-Tom
""" Integration test of intids
"""
__docformat__ = 'restructuredtext'

import unittest
from zope.app.testing import functional
from zope.app.workflow.stateful.definition import StatefulProcessDefinition
from zope import component
from zope.app.intid import UniqueIdUtility
from zope.app.intid.interfaces import IIntIds
import transaction

class WorkflowTestCase(functional.BrowserTestCase):

    def test_withoutintids(self):
    
        response = self.publish('/+/action.html', 
            form={'type_name':u'zope.app.workflow.StatefulProcessDefinition',
                  'id':u'foo'},
            basic='mgr:mgrpw')
        self.assertEqual(response.getStatus(), 302)
        self.assert_(u'foo' in self.getRootFolder().keys())

    def test_withintids(self):


        root = self.getRootFolder()
        uid = root['intids'] = UniqueIdUtility()
        sm = component.getSiteManager()
        sm.registerUtility(uid, IIntIds, u'intid')
        transaction.commit()

        response = self.publish('/+/action.html', 
            form={'type_name':u'zope.app.workflow.StatefulProcessDefinition',
                  'id':u'foo'},
            basic='mgr:mgrpw')

        self.assert_(u'foo' in root.keys())


def test_suite():
    """ This is the unittest suite """
    return unittest.TestSuite((
        unittest.makeSuite(WorkflowTestCase),
        ))

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to