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())
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())
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())