def test_factory(self): """ :return: """ fti = queryUtility(IDexterityFTI, name=CONTENT_TYPE_SCHOOL) obj = createObject(fti.factory) self.assertTrue(ISchool.providedBy(obj))
def test_adding(self): """ :return: """ self.portal.invokeFactory(CONTENT_TYPE_SCHOOL, 'school') school = self.portal['school'] self.assertTrue(ISchool.providedBy(school)) school.setTitle('My Test School') school.reindexObject() result = self.portal.portal_catalog.searchResults(id=school.id) self.assertEquals(1, len(result)) self.assertEquals(result[0].Title, 'My Test School')