コード例 #1
0
    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)
コード例 #2
0
    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
コード例 #3
0
    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)
コード例 #4
0
    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