コード例 #1
0
 def test_virtual_hosting(self):
     from Products.SiteAccess.VirtualHostMonster import manage_addVirtualHostMonster
     from Products.SiteAccess.VirtualHostMonster import VirtualHostMonster
     manage_addVirtualHostMonster(self.app)
     self.assertTrue(VirtualHostMonster.id in self.app.objectIds())
     self.portal.invokeFactory('Document', 'a_page')
     self.assertTrue('a_page' in self.portal.objectIds())
     self.portal.invokeFactory('Folder', 'a_folder')
     self.assertTrue('a_folder' in self.portal.objectIds())
     import transaction
     transaction.commit()
     browser = Browser(self.app)
     browser.addHeader(
         'Authorization', 'Basic %s:%s' % (
             TEST_USER_NAME,
             TEST_USER_PASSWORD,
         ))
     url = self.app.absolute_url(
     ) + '/VirtualHostBase/http/www.buystuff.com:80/plone/a_page?MIGHT_REDIRECT=1'
     browser.open(url)
     self.assertEqual(url, browser.url)
     url = self.app.absolute_url(
     ) + '/VirtualHostBase/http/www.buystuff.com:80/plone/a_folder/a_page?MIGHT_REDIRECT=1'
     browser.open(url)
     self.assertNotEqual(url, browser.url)
     browser.handleErrors = False
     url = self.app.absolute_url(
     ) + '/VirtualHostBase/http/www.buystuff.com:80/plone/VirtualHostRoot/_vh_z/a_page?MIGHT_REDIRECT=1'
     browser.open(url)
     self.assertEqual(url, browser.url)
コード例 #2
0
    def test_search_in_vhm(self):
        # Install a Virtual Host Monster
        if 'virtual_hosting' not in self.app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(self.app, 'virtual_hosting')
        transaction.commit()

        # we don't get a result if we do not provide the full physical path
        response = self.api_session.get('/@search?path=/folder',)
        self.assertSetEqual(set(), set(result_paths(response.json())))

        # If we go through the VHM will will get results if we only use
        # the part of the path inside the VHM
        vhm_url = (
            '%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s' %
            (self.app.absolute_url(), '@search?path=/folder'))
        response = self.api_session.get(vhm_url)
        self.assertSetEqual(
            {u'/folder',
             u'/folder/doc',
             u'/folder/other-document'},
            set(result_paths(response.json())))
コード例 #3
0
ファイル: test_search.py プロジェクト: plone/plone.restapi
    def test_search_use_site_search_settings_with_vhm(self):

        if "virtual_hosting" not in self.app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster import (
                manage_addVirtualHostMonster, )

            manage_addVirtualHostMonster(self.app, "virtual_hosting")
        transaction.commit()

        vhm_url = "{}/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/{}".format(
            self.app.absolute_url(),
            "/@search",
        )
        response = self.api_session.get(vhm_url,
                                        params={
                                            "use_site_search_settings": 1,
                                            "path": "/"
                                        }).json()
        titles = sorted([
            "Another Folder",
            "Doc outside folder",
            "Document in second folder",
            "Lorem Ipsum",
            "Other Document",
            "Some Folder",
        ])
        self.assertEqual(sorted([item["title"] for item in response["items"]]),
                         titles)

        noLongerProvides(self.folder, INavigationRoot)
        transaction.commit()
コード例 #4
0
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml',
                       Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        import ftw.upgrade
        xmlconfig.file('configure.zcml',
                       ftw.upgrade,
                       context=configurationContext)

        z2.installProduct(app, 'Products.DateRecurringIndex')
        import plone.app.contenttypes
        xmlconfig.file('configure.zcml',
                       plone.app.contenttypes,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        try:
            # Plone 4 with collective.indexing
            pkg_resources.get_distribution('collective.indexing')
        except pkg_resources.DistributionNotFound:
            pass
        else:
            import collective.indexing
            xmlconfig.file('configure.zcml',
                           collective.indexing,
                           context=configurationContext)
            z2.installProduct(app, 'collective.indexing')

        manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #5
0
ファイル: test_search.py プロジェクト: plone/plone.restapi
    def test_search_in_vhm(self):
        # Install a Virtual Host Monster
        if "virtual_hosting" not in self.app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster import (
                manage_addVirtualHostMonster, )

            manage_addVirtualHostMonster(self.app, "virtual_hosting")
        transaction.commit()

        # we don't get a result if we do not provide the full physical path
        response = self.api_session.get("/@search?path=/folder")
        self.assertSetEqual(set(), set(result_paths(response.json())))

        # If we go through the VHM will will get results if we only use
        # the part of the path inside the VHM
        vhm_url = "{}/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/{}".format(
            self.app.absolute_url(),
            "@search?path=/folder",
        )
        response = self.api_session.get(vhm_url)
        self.assertSetEqual(
            {"/folder", "/folder/doc", "/folder/other-document"},
            set(result_paths(response.json())),
        )
コード例 #6
0
ファイル: testing.py プロジェクト: 4teamwork/ftw.upgrade
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        import ftw.upgrade
        xmlconfig.file('configure.zcml', ftw.upgrade,
                       context=configurationContext)

        z2.installProduct(app, 'Products.DateRecurringIndex')
        import plone.app.contenttypes
        xmlconfig.file('configure.zcml', plone.app.contenttypes,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        try:
            # Plone 4 with collective.indexing
            pkg_resources.get_distribution('collective.indexing')
        except pkg_resources.DistributionNotFound:
            pass
        else:
            import collective.indexing
            xmlconfig.file('configure.zcml', collective.indexing,
                           context=configurationContext)
            z2.installProduct(app, 'collective.indexing')

        manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #7
0
ファイル: testing.py プロジェクト: Vinsurya/Plone
    def setUpZope(self, app, configurationContext):
        # load ZCML
        import plone.app.blocks
        self.loadZCML(package=plone.app.blocks)

        # Register directory for testing
        xmlconfig.string("""\
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="plone"
    package="plone.app.blocks.tests">

    <plone:static
        type="sitelayout"
        name="testlayout1"
        directory="resources/sitelayout/testlayout1"
        />

    <plone:static
        type="sitelayout"
        name="testlayout2"
        directory="resources/sitelayout/testlayout2"
        />

</configure>
""", context=configurationContext)
        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #8
0
ファイル: testing.py プロジェクト: CGTIC/Plone_SP
    def setUpZope(self, app, configurationContext):
        if PLONE_VERSION.startswith('5'):
            import plone.app.contenttypes
            self.loadZCML(package=plone.app.contenttypes)
        else:
            # needed by plone.app.linkintegrity under Plone 4.x
            import plone.app.referenceablebehavior
            self.loadZCML(package=plone.app.referenceablebehavior)

            if DEXTERITY_ONLY:
                import plone.app.contenttypes
                self.loadZCML(package=plone.app.contenttypes)
                z2.installProduct(app, 'Products.DateRecurringIndex')

            if HAS_PFG:
                import Products.PloneFormGen
                self.loadZCML(package=Products.PloneFormGen)
                z2.installProduct(app, 'Products.PloneFormGen')

        import collective.cover
        self.loadZCML(package=collective.cover)

        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #9
0
ファイル: testing.py プロジェクト: glenn27/collective.cover
    def setUpZope(self, app, configurationContext):
        if IS_PLONE_5:
            import plone.app.contenttypes
            self.loadZCML(package=plone.app.contenttypes)
        else:
            # needed by plone.app.linkintegrity under Plone 4.x
            import plone.app.referenceablebehavior
            self.loadZCML(package=plone.app.referenceablebehavior)

            if DEXTERITY_ONLY:
                import plone.app.contenttypes
                self.loadZCML(package=plone.app.contenttypes)
                z2.installProduct(app, 'Products.DateRecurringIndex')

            if HAS_PFG:
                import Products.PloneFormGen
                self.loadZCML(package=Products.PloneFormGen)
                z2.installProduct(app, 'Products.PloneFormGen')

        import collective.cover
        self.loadZCML(package=collective.cover)

        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #10
0
    def setUpZope(self, app, configurationContext):
        # load ZCML
        import plone.app.blocks
        self.loadZCML(package=plone.app.blocks)

        # Register directory for testing
        xmlconfig.string("""\
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="plone"
    package="plone.app.blocks.tests">

    <plone:static
        type="sitelayout"
        name="testlayout1"
        directory="resources/sitelayout/testlayout1"
        />

    <plone:static
        type="sitelayout"
        name="testlayout2"
        directory="resources/sitelayout/testlayout2"
        />

</configure>
""",
                         context=configurationContext)
        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #11
0
 def setUpZope(self, app, configurationContext):
     super(RobotFixture, self).setUpZope(app, configurationContext)
     if 'virtual_hosting' not in app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #12
0
 def test_with_virtualhost(self):
     manage_addVirtualHostMonster(self.app, 'virtual_hosting')
     transaction.commit()
     path = ("/VirtualHostBase/http/some_host:80/%s/VirtualHostRoot/" %
      self.portal.getId())
     host, port = self.layer['zserver_info']
     url = "http://%(host)s:%(port)i%(path)s/@@wkpdf" % locals()
     result = urlopen(url)
     pdf_data = result.read()
     self.pdf_contains(pdf_data, 'PdfPortal')
コード例 #13
0
 def test_with_virtualhost(self):
     manage_addVirtualHostMonster(self.app, 'virtual_hosting')
     transaction.commit()
     path = ("/VirtualHostBase/http/some_host:80/%s/VirtualHostRoot/" %
             self.portal.getId())
     host, port = self.layer['zserver_info']
     url = "http://%(host)s:%(port)i%(path)s/@@wkpdf" % locals()
     result = urlopen(url)
     pdf_data = result.read()
     self.pdf_contains(pdf_data, 'PdfPortal')
コード例 #14
0
    def test_add_manage_addVirtualHostMonster(self):
        from Products.SiteAccess.VirtualHostMonster import \
            manage_addVirtualHostMonster
        from Products.SiteAccess.VirtualHostMonster import VirtualHostMonster
        from ZPublisher.BeforeTraverse import queryBeforeTraverse
        manage_addVirtualHostMonster(self.root)

        self.assertTrue(VirtualHostMonster.id in self.root.objectIds())
        hook = queryBeforeTraverse(self.root, VirtualHostMonster.meta_type)
        self.assertTrue(hook)
コード例 #15
0
    def test_add_manage_addVirtualHostMonster(self):
        from Products.SiteAccess.VirtualHostMonster import \
            manage_addVirtualHostMonster
        from Products.SiteAccess.VirtualHostMonster import VirtualHostMonster
        from ZPublisher.BeforeTraverse import queryBeforeTraverse
        manage_addVirtualHostMonster(self.root)

        self.assertTrue(VirtualHostMonster.id in self.root.objectIds())
        hook = queryBeforeTraverse(self.root, VirtualHostMonster.meta_type)
        self.assertTrue(hook)
コード例 #16
0
    def setUpZope(self, app, configurationContext):
        # Load ZCML
        import collective.localheaderandfooter
        self.loadZCML(package=collective.localheaderandfooter)

        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #17
0
    def test_search_in_vhm_multiple_paths(self):
        # Install a Virtual Host Monster
        if "virtual_hosting" not in self.app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster import (
                manage_addVirtualHostMonster,
            )

            manage_addVirtualHostMonster(self.app, "virtual_hosting")
        transaction.commit()

        # path as a list
        query = {"path": ["/folder", "/folder2"]}

        # If we go through the VHM we will get results for multiple paths
        # if we only use the part of the path inside the VHM
        vhm_url = "%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s" % (
            self.app.absolute_url(),
            "@search",
        )
        response = self.api_session.get(vhm_url, params=query)
        self.assertSetEqual(
            {
                u"/folder",
                u"/folder/doc",
                u"/folder/other-document",
                u"/folder2",
                u"/folder2/doc",
            },
            set(result_paths(response.json())),
        )

        # path as a dict with a query list
        query = {"path.query": ["/folder", "/folder2"]}

        # If we go through the VHM we will get results for multiple paths
        # if we only use the part of the path inside the VHM
        vhm_url = "%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s" % (
            self.app.absolute_url(),
            "@search",
        )
        response = self.api_session.get(vhm_url, params=query)
        self.assertSetEqual(
            {
                u"/folder",
                u"/folder/doc",
                u"/folder/other-document",
                u"/folder2",
                u"/folder2/doc",
            },
            set(result_paths(response.json())),
        )
コード例 #18
0
ファイル: testing.py プロジェクト: Vinsurya/Plone
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        import ftw.upgrade
        xmlconfig.file('configure.zcml', ftw.upgrade,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #19
0
 def setUp(self):
     transaction.begin()
     self.app = makerequest(Zope2.app())
     try:
         if not hasattr(self.app, 'virtual_hosting'):
             # If ZopeLite was imported, we have no default virtual host monster
             from Products.SiteAccess.VirtualHostMonster import manage_addVirtualHostMonster
             manage_addVirtualHostMonster(self.app, 'virtual_hosting')
         self.app.manage_addFolder('folder')
         self.app.folder.manage_addDTMLMethod('doc', '')
         self.app.REQUEST.set('PARENTS', [self.app])
         self.traverse = self.app.REQUEST.traverse
     except:
         self.tearDown()
コード例 #20
0
 def setUp(self):
     transaction.begin()
     self.app = makerequest(Zope2.app())
     try:
         if not hasattr(self.app, 'virtual_hosting'):
             # If ZopeLite was imported, we have no default virtual host monster
             from Products.SiteAccess.VirtualHostMonster import manage_addVirtualHostMonster
             manage_addVirtualHostMonster(self.app, 'virtual_hosting')
         self.app.manage_addFolder('folder')
         self.app.folder.manage_addDTMLMethod('doc', '')
         self.app.REQUEST.set('PARENTS', [self.app])
         self.traverse = self.app.REQUEST.traverse
     except:
         self.tearDown()
コード例 #21
0
ファイル: testing.py プロジェクト: prodamspsites/prodam.tiles
 def setUpZope(self, app, configurationContext):
     import Products.PloneFormGen
     self.loadZCML(package=Products.PloneFormGen)
     z2.installProduct(app, 'Products.PloneFormGen')
     # Load ZCML
     import collective.cover
     self.loadZCML(package=collective.cover)
     if 'virtual_hosting' not in app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(app, 'virtual_hosting')
     import prodam.tiles
     self.loadZCML(package=prodam.tiles)
コード例 #22
0
 def setUp(self):
     import transaction
     from Testing.makerequest import makerequest
     from Testing.ZopeTestCase.ZopeLite import app
     transaction.begin()
     self.app = makerequest(app())
     if 'virtual_hosting' not in self.app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(self.app, 'virtual_hosting')
     self.app.manage_addFolder('folder')
     self.app.folder.manage_addDTMLMethod('doc', '')
     self.app.REQUEST.set('PARENTS', [self.app])
     self.traverse = self.app.REQUEST.traverse
コード例 #23
0
 def setUp(self):
     import transaction
     from Testing.makerequest import makerequest
     from Testing.ZopeTestCase.ZopeLite import app
     transaction.begin()
     self.app = makerequest(app())
     if 'virtual_hosting' not in  self.app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(self.app, 'virtual_hosting')
     self.app.manage_addFolder('folder')
     self.app.folder.manage_addDTMLMethod('doc', '')
     self.app.REQUEST.set('PARENTS', [self.app])
     self.traverse = self.app.REQUEST.traverse
コード例 #24
0
    def setUpZope(self, app, configurationContext):
        import Products.PloneFormGen
        self.loadZCML(package=Products.PloneFormGen)
        z2.installProduct(app, 'Products.PloneFormGen')

        # Load ZCML
        import collective.cover
        self.loadZCML(package=collective.cover)
        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
        import brasil.gov.tiles
        self.loadZCML(package=brasil.gov.tiles)
        self.loadZCML(name='overrides.zcml', package=brasil.gov.tiles)
コード例 #25
0
    def setUpZope(self, app, configurationContext):
        # XXX: do not install (yet) PFG in Plone 5
        if HAS_PFG and PLONE_VERSION < '5.0':
            import Products.PloneFormGen
            self.loadZCML(package=Products.PloneFormGen)
            z2.installProduct(app, 'Products.PloneFormGen')

        # Load ZCML
        import collective.cover
        self.loadZCML(package=collective.cover)

        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #26
0
ファイル: testing.py プロジェクト: mhora/collective.cover
    def setUpZope(self, app, configurationContext):
        # XXX: do not install (yet) PFG in Plone 5
        if HAS_PFG and PLONE_VERSION < '5.0':
            import Products.PloneFormGen
            self.loadZCML(package=Products.PloneFormGen)
            z2.installProduct(app, 'Products.PloneFormGen')

        # Load ZCML
        import collective.cover
        self.loadZCML(package=collective.cover)

        if 'virtual_hosting' not in app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #27
0
 def setUpZope(self, app, configurationContext):
     import Products.PloneFormGen
     self.loadZCML(package=Products.PloneFormGen)
     z2.installProduct(app, 'Products.PloneFormGen')
     # Load ZCML
     import collective.cover
     self.loadZCML(package=collective.cover)
     # XXX: https://github.com/collective/collective.cover/issues/81
     #import plone.app.imagetile
     #self.loadZCML(package=plone.app.imagetile)
     #import plone.app.texttile
     #self.loadZCML(package=plone.app.imagetile)
     if 'virtual_hosting' not in app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #28
0
ファイル: testing.py プロジェクト: Adniel/collective.cover
 def setUpZope(self, app, configurationContext):
     import Products.PloneFormGen
     self.loadZCML(package=Products.PloneFormGen)
     installProduct(app, 'Products.PloneFormGen')
     # Load ZCML
     import collective.cover
     self.loadZCML(package=collective.cover)
     # XXX: https://github.com/collective/collective.cover/issues/81
     #import plone.app.imagetile
     #self.loadZCML(package=plone.app.imagetile)
     #import plone.app.texttile
     #self.loadZCML(package=plone.app.imagetile)
     if 'virtual_hosting' not in app.objectIds():
         # If ZopeLite was imported, we have no default virtual
         # host monster
         from Products.SiteAccess.VirtualHostMonster \
             import manage_addVirtualHostMonster
         manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #29
0
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml',
                       Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        import ftw.upgrade
        xmlconfig.file('configure.zcml',
                       ftw.upgrade,
                       context=configurationContext)

        z2.installProduct(app, 'Products.DateRecurringIndex')
        import plone.app.contenttypes
        xmlconfig.file('configure.zcml',
                       plone.app.contenttypes,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        manage_addVirtualHostMonster(app, 'virtual_hosting')
コード例 #30
0
    def test_search_in_vhm_multiple_paths(self):
        # Install a Virtual Host Monster
        if 'virtual_hosting' not in self.app.objectIds():
            # If ZopeLite was imported, we have no default virtual
            # host monster
            from Products.SiteAccess.VirtualHostMonster \
                import manage_addVirtualHostMonster
            manage_addVirtualHostMonster(self.app, 'virtual_hosting')
        transaction.commit()

        # path as a list
        query = {'path': ['/folder', '/folder2']}

        # If we go through the VHM we will get results for multiple paths
        # if we only use the part of the path inside the VHM
        vhm_url = (
            '%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s' %
            (self.app.absolute_url(), '@search'))
        response = self.api_session.get(vhm_url, params=query)
        self.assertSetEqual(
            {
                u'/folder', u'/folder/doc', u'/folder/other-document',
                u'/folder2', u'/folder2/doc'
            }, set(result_paths(response.json())))

        # path as a dict with a query list
        query = {'path.query': ['/folder', '/folder2']}

        # If we go through the VHM we will get results for multiple paths
        # if we only use the part of the path inside the VHM
        vhm_url = (
            '%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s' %
            (self.app.absolute_url(), '@search'))
        response = self.api_session.get(vhm_url, params=query)
        self.assertSetEqual(
            {
                u'/folder', u'/folder/doc', u'/folder/other-document',
                u'/folder2', u'/folder2/doc'
            }, set(result_paths(response.json())))