Skip to content

Commit

Permalink
added test acquisition chain for unwrapped object
Browse files Browse the repository at this point in the history
Conflicts:
	plone/app/discussion/tests/test_acquisition.py
  • Loading branch information
vmaksymiv authored and evilbungle committed Nov 21, 2013
1 parent 5fb6968 commit 8e56b99
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion plone/app/discussion/tests/test_acquisition.py
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_chain
from AccessControl.User import User # before SpecialUsers
from AccessControl.SpecialUsers import nobody as user_nobody
from AccessControl.PermissionRole import rolesForPermissionOn
from Acquisition import aq_chain, aq_base
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.interfaces import IConversation
Expand Down Expand Up @@ -140,6 +143,25 @@ def test_acquisition_chain(self):
for (index, item) in enumerate(dx_conversation_chain):
self.assertEqual(item, dx_comment_chain[index + 1])

def test_acquisition_base_object_chain(self):
""" The acquisition chain for the object without wrappers should return
list which contains only the object.
"""

at_object_base_chain = aq_chain(aq_base(self.archetypes_object))
dx_object_base_chain = aq_chain(aq_base(self.dexterity_object))

# Fails: acquisition chain has more than one object
self.assertTrue(len(at_object_base_chain) == 1)
self.assertTrue(len(dx_object_base_chain) == 1)

at_comment_base_chain = aq_chain(aq_base(self.archetypes_comment))
dx_comment_base_chain = aq_chain(aq_base(self.dexterity_comment))

# Fails: acquisition chain has more than one object
self.assertTrue(len(at_comment_base_chain) == 1)
self.assertTrue(len(dx_comment_base_chain) == 1)


def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__)

1 comment on commit 8e56b99

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TESTS FAILED
Mr.roboto url : http://jenkins.plone.org/roboto/get_info?push=6657eaf883184e1980a4b871a71918e4
plone-5.0-python-2.7 [FAILURE]

Please sign in to comment.