Ejemplo n.º 1
0
    def afterSetUp(self):
        """ Adding an OAIServer, a ZCatalog and a ZCatalogHarvester

        """
        manage_addZCatalog(self.app, 'catalog', 'Catalog')
        manage_addOAIServer(self.app, 'oai', title=u'OAI Server')

        manage_addFolder(self.app, 'folder', 'Folder')
        self.app.folder.description = u'Some descr'

        manage_addFolder(self.app, 'folder1', 'Folder1')
        self.app.folder1.description = u'Some descr111'

        self.app.catalog.catalog_object(self.app.folder,
                                        self.app.folder.absolute_url(1))
        self.app.catalog.catalog_object(self.app.folder1,
                                        self.app.folder1.absolute_url(1))

        manage_addZCatalogHarvester(self.app.oai, 'harvester',
                                    title=u'Harvester',
                                    search_meta_types=Folder.meta_type)

        self.server = startZServer()
        self.server_url = 'http://%s:%s/' % (self.server[0],
                                             str(self.server[1]))
Ejemplo n.º 2
0
 def __init__(self):
     self.browser = Browser(driver_name='firefox')
     self.host, self.port = startZServer()
Ejemplo n.º 3
0
 def start_zserver(self, web_browser_name='firefox'):
     """Start ZServer so we can inspect site state with a normal browser
     like FireFox."""
     from Testing.ZopeTestCase.utils import startZServer
     echo = startZServer()
     webbrowser.get(web_browser_name).open('http://%s:%s/plone' % echo)
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-

# Este arquivo contém trechos de código que podem ser usados para inspeção rápida no prompt

from zope.annotation import IAnnotations
aa = IAnnotations(context)['il.portalinterlegis.boxes']
aa['ISimpleBox_1']

from il.portalinterlegis.browser.boxes import BoxManager
from il.portalinterlegis.browser.interfaces import ISimpleBox
boxmanager = BoxManager(ISimpleBox)
boxmanager.box_content(context, 1)

from Testing.ZopeTestCase.utils import startZServer
startZServer()

with open("out", "w+") as f: f.write(browser.contents)


################################################################
 Fotografia de um estado das anotacoes da home
################################################################
{'IAcompanheOInterlegis_0': {},
 'IAcompanheOInterlegis_1': {},
 'ICalendar_0': {},
 'ICalendar_1': {},
 'ICalendar_2': {},
 'ICalendar_3': {},
 'ICarouselItem_0': {'image': u'/++theme++il.portalinterlegis/temp/images/1.jpg',
  'target': '/news/nova-noticia',
  'text': u'<p>aaaaaaaaaaaaa</p>',
Ejemplo n.º 5
0
 def setUp(self):
     # Start two-threaded zserver
     # One will start the phantomjs binary, the other will respond to it
     self['zserver_info'] = startZServer(number_of_threads=2)