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