[Zope-CMF] Re: SVN: Products.GenericSetup/branches/1.3/Products/GenericSetup/ Merge 84270 from trunk: During object manager imports do not throw an

Tres Seaver tseaver at palladion.com
Wed Feb 27 14:39:18 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maurits van Rees wrote:
> Log message for revision 84271:
>   Merge 84270 from trunk: During object manager imports do not throw an
>   error when trying to remove an object that was already removed.

<snip>

> +class ObjectManagerHelpersTests(unittest.TestCase):
> +
> +    def _getTargetClass(self):
> +        from Products.GenericSetup.utils import ObjectManagerHelpers
> +
> +        return ObjectManagerHelpers
> +
> +    def _makeOne(self, *args, **kw):
> +        from Products.GenericSetup.utils import NodeAdapterBase
> +
> +        class Foo(self._getTargetClass(), NodeAdapterBase):
> +
> +            pass
> +
> +        return Foo(*args, **kw)
> +
> +    def setUp(self):
> +        from OFS.ObjectManager import ObjectManager
> +
> +        obj = ObjectManager('obj')
> +        self.helpers = self._makeOne(obj, DummySetupEnviron())
> +
> +    def test__initObjects(self):
> +        obj = self.helpers.context
> +        self.failIf('history' in obj.objectIds())
> +
> +        # Add object
> +        node = parseString(_ADD_IMPORT).documentElement
> +        self.helpers._initObjects(node)
> +        self.failUnless('history' in obj.objectIds())
> +
> +        # Remove it again
> +        node = parseString(_REMOVE_IMPORT).documentElement
> +        self.helpers._initObjects(node)
> +        self.failIf('history' in obj.objectIds())
> +        
> +        # Removing it a second time should not throw an
> +        # AttributeError.
> +        node = parseString(_REMOVE_IMPORT).documentElement
> +        self.helpers._initObjects(node)
> +        self.failIf('history' in obj.objectIds())
> +        
> +

Marits, the new test you wrote here is failing when run on the Zope 2.11
branch or the trunk[1]:  can you please diagnose why, and remediate?

[1] http://mail.zope.org/pipermail/cmf-tests/2008-February/008099.html



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHxbxm+gerLs4ltQ4RAiWmAKDLO1x0Ei1bwQ0XgNBd6lQ4i63SJACgsiim
vMtCQ80/yVt+hP47iwtIQAU=
=rOoi
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list