예제 #1
0
    def testExecute(self):
        e = TalesExpressionCondition()
        e.tales_expression = 'python:"plone" in object.Subject()'

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertEqual(False, ex())

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable)
        self.assertEqual(False, ex())

        self.folder.setSubject(('plone', 'contentrules'))
        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertEqual(True, ex())
    def testExecute(self):
        e = TalesExpressionCondition()
        e.tales_expression = 'python:"plone" in object.Subject()'

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertEquals(False, ex())

        ex = getMultiAdapter((self.portal, e, DummyEvent(self.portal)), IExecutable)
        self.assertEquals(False, ex())

        self.folder.setSubject(('plone', 'contentrules'))
        ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
        self.assertEquals(True, ex())
예제 #3
0
 def testExecuteUnicodeString(self):
     e = TalesExpressionCondition()
     e.tales_expression = u'string:${portal_url}'
     ex = getMultiAdapter(
         (self.portal, e, DummyEvent(self.folder)), IExecutable)
     self.assertEqual(True, ex())
예제 #4
0
 def testExecuteUnicodeString(self):
     e = TalesExpressionCondition()
     e.tales_expression = u'string:${portal_url}'
     ex = getMultiAdapter((self.portal, e, DummyEvent(self.folder)), IExecutable)
     self.assertEqual(True, ex())