Ejemplo n.º 1
0
 def test_execute_object_without_subject(self):
     e = SubjectAction()
     e.same_as_parent = False
     e.subject = ['Bar', ]
     o = self.folder['cmf']
     ex = getMultiAdapter((self.folder, e,
                          DummyEvent(o)),
                          IExecutable)
     self.assertEquals(False, ex())
Ejemplo n.º 2
0
    def test_execute_same_as_parent(self):
        e = SubjectAction()
        e.same_as_parent = True
        e.subject = []

        ex = getMultiAdapter((self.folder, e,
                             DummyEvent(self.sub_folder)),
                             IExecutable)
        self.assertEquals(True, ex())

        self.assertEquals(self.sub_folder.Subject(), self.folder.Subject())
Ejemplo n.º 3
0
    def test_execute_with_subject(self):
        e = SubjectAction()
        e.same_as_parent = False
        e.subject = ['Bar', ]

        ex = getMultiAdapter((self.folder, e,
                             DummyEvent(self.sub_folder)),
                             IExecutable)
        self.assertEquals(True, ex())

        self.assertEquals(list(self.sub_folder.Subject()),
                          e.subject)