def setUp(self): self.portal = self.layer['portal'] setRoles(self.portal, TEST_USER_ID, ['Reviewer', 'Manager']) self.request = self.portal.REQUEST # fti self.fti_note = DexterityFTI('event_note') self.fti_note.schema = dottedname(INoteSchemaPrimary) self.portal.portal_types._setObject('event_note', self.fti_note) # register register(self.fti_note) class MockEvent(object): # History: [[interface, context], ] event_history = [] def mock_handler(self, event): self.event_history.append(event, ) def last_event(self): return self.event_history[-1] self.mock_event = MockEvent()
def setUp(self): self.portal = self.layer['portal'] setRoles(self.portal, TEST_USER_ID, ['Reviewer', 'Manager']) self.request = self.portal.REQUEST # fti self.fti_note = DexterityFTI('note') self.fti_note.schema = dottedname(INoteSchemaPrimary) self.portal.portal_types._setObject('note', self.fti_note) self.fti_invi = DexterityFTI('invitation') self.fti_invi.schema = dottedname(IInvitationSchemaNonPrimary) self.portal.portal_types._setObject('invitation', self.fti_invi) # register register(self.fti_note) register(self.fti_invi)
def setUp(self): self.portal = self.layer['portal'] setRoles(self.portal, TEST_USER_ID, ['Reviewer', 'Manager']) self.request = self.portal.REQUEST # fti self.fti_namedfile = DexterityFTI('namedfile') self.fti_namedfile.schema = dottedname(INamedFileSchema) self.portal.portal_types._setObject('namedfile', self.fti_namedfile) register(self.fti_namedfile) self.store_have_blobs = ftwdexterity.HAVE_BLOBS