示例#1
0
文件: testsuite.py 项目: Jc2k/sashimi
    def test_fuzz(self):
        report = HtmlReport("log.html")
        report.start()

        self.loginAsPortalOwner()

        a = ContentTypeVisitor(self.portal)
        map = a.visit_types()

        urls = CreateSiteStructure(map, self.portal).create(report)

        try:
            self.browser_login("editor")
        except:
            # login will generally work, but the redirect to /portal might kill us
            pass

        for content in urls:
            try:
                content.browse(self.browser)
            except:
                report.exception(content)
            else:
                report.success(content)

        report.finish()
示例#2
0
    def test_simple_content_type(self):
        portal = Mock()
        portal.portal_types = IndexableObject(Mock())
        portal.portal_types['Folder'].allowed_content_types = ['Folder']
        portal.portal_types.listContentTypes.return_value = ["Folder"]
        c = ContentTypeVisitor(portal)
        retval = c.visit_types()

        visitor = Mock()
        retval.visit(visitor)

        for args, kwargs in visitor.enter_node.call_args_list:
            node = args[0]
            print node.get_breadcrumb()
示例#3
0
 def test_no_content_types(self):
     portal = Mock()
     portal.portal_types.listContentTypes.return_value = []
     c = ContentTypeVisitor(portal)
     retval = c.visit_types()
     self.failUnless(isinstance(retval, ContentTypeRoot))