def test_not_appear_in_listing(self): """ Check that mobile behavior prevents items to appear in the listing. """ behavior = IMobileBehavior(self.portal.folder.doc2) behavior.appearInFolderListing = False behavior.save() # self.assertEqual(self.getItems(self.portal.folder), None) items = self.getItems(self.portal.folder) self.assertEqual(len(self.getItems(self.portal.folder)), 1)
def test_setter(self): """ Try behavior properties """ self.loginAsPortalOwner() self.portal.invokeFactory("Document", "doc") doc = self.portal.doc self.assertTrue(IMobileContentish.providedBy(doc)) behavior = IMobileBehavior(doc) self.assertTrue(isinstance(behavior, MobileBehaviorStorage)) self.assertEqual(behavior.mobileFolderListing, True) behavior.mobileFolderListing = False
def make_some_evil_site_content(self): """ Add annotations etc. around the site """ self.loginAsPortalOwner() self.portal.invokeFactory("Document", "doc") doc = self.portal.doc behavior = IMobileBehavior(doc) behavior.mobileFolderListing = False behavior.save() annotations = IAnnotations(doc)
def test_shit_input(self): """ Try put in bad data """ self.loginAsPortalOwner() self.portal.invokeFactory("Document", "doc") doc = self.portal.doc behavior = IMobileBehavior(doc) try: behavior.mobileFolderListing = "xxx" raise AssertionError("Should not be never reached") except WrongType: pass