Skip to content

Commit

Permalink
failing test for edge case where parent pointers are returned with un…
Browse files Browse the repository at this point in the history
…wanted wrapping
  • Loading branch information
davisagli committed Nov 1, 2011
1 parent 4cf198e commit 442c205
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Acquisition/tests.py
Expand Up @@ -2362,7 +2362,7 @@ def test___parent__aq_parent_circles():
>>> x.__parent__.__parent__ is x
True
>>> x.hello
'world'
>>> Acquisition.aq_acquire(x, 'hello')
Expand Down Expand Up @@ -2396,6 +2396,23 @@ def test___parent__aq_parent_circles():
AttributeError: non_existant_attr
"""

def test_unwrapped_implicit_acquirer_unwraps__parent__():
"""
Set up an implicit acquirer with a parent:
>>> class Impl(Acquisition.Implicit):
... pass
>>> y = Impl()
>>> x = Impl()
>>> x.__parent__ = y
Now if we retrieve the parent from the (unwrapped) instance,
the parent should not be wrapped in the instance's acquisition chain.
>>> x.__parent__ is y
True
"""

import unittest
from doctest import DocTestSuite, DocFileSuite
Expand Down

0 comments on commit 442c205

Please sign in to comment.