Back to index

plone3  3.1.7
Public Member Functions
plone.app.contentrules.tests.test_traversal.TestTraversal Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_traversal.TestTraversal:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_traversal.TestTraversal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testTraverseToRule
def testTraverseToRuleCondition
def testTraverseToRuleAction

Detailed Description

Definition at line 13 of file test_traversal.py.


Member Function Documentation

Definition at line 15 of file test_traversal.py.

00015 
00016     def afterSetUp(self):
00017         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 18 of file test_traversal.py.

00018 
00019     def testTraverseToRule(self):
00020         r = Rule()
00021         storage = getUtility(IRuleStorage)
00022         storage[u'r1'] = r
00023         traversed = self.portal.restrictedTraverse('++rule++r1')
00024         self.failUnless(aq_parent(traversed) is self.portal)
00025         self.failUnless(aq_base(traversed) is r)
    

Here is the call graph for this function:

Definition at line 49 of file test_traversal.py.

00049 
00050     def testTraverseToRuleAction(self): 
00051         r = Rule()
00052         e1 = DummyAction()
00053         e1.x = "x"
00054         
00055         e2 = DummyAction()
00056         e2.x = "y"
00057         
00058         r.actions.append(e1)
00059         r.actions.append(e2)
00060         storage = getUtility(IRuleStorage)
00061         storage[u'r1'] = r
00062         
00063         tr = self.portal.restrictedTraverse('++rule++r1')
00064         te1 = tr.restrictedTraverse('++action++0')
00065         te2 = tr.restrictedTraverse('++action++1')
00066         
00067         self.failUnless(aq_parent(te1) is tr)
00068         self.assertEquals("x", te1.x)
00069         
00070         self.failUnless(aq_parent(te2) is tr)
00071         self.assertEquals("y", te2.x)        
        

Definition at line 26 of file test_traversal.py.

00026 
00027     def testTraverseToRuleCondition(self): 
00028         r = Rule()
00029         e1 = DummyCondition()
00030         e1.x = "x"
00031         
00032         e2 = DummyCondition()
00033         e2.x = "y"
00034         
00035         r.conditions.append(e1)
00036         r.conditions.append(e2)
00037         storage = getUtility(IRuleStorage)
00038         storage[u'r1'] = r
00039         
00040         tr = self.portal.restrictedTraverse('++rule++r1')
00041         te1 = tr.restrictedTraverse('++condition++0')
00042         te2 = tr.restrictedTraverse('++condition++1')
00043         
00044         self.failUnless(aq_parent(te1) is tr)
00045         self.assertEquals("x", te1.x)
00046         
00047         self.failUnless(aq_parent(te2) is tr)
00048         self.assertEquals("y", te2.x)


The documentation for this class was generated from the following file: