Example #1
0
 def wrapper(*args, **kwargs):
     site = getSite()
     pushGlobalRegistry(site)
     try:
         register_static_uid_uitility(prefix=prefix or func.__name__)
         return func(*args, **kwargs)
     finally:
         popGlobalRegistry(site)
Example #2
0
    def tearDown(self):
        # disable create_inital_version handler for og.documents
        # otherwise we have some savepoints problems with the sqlite db
        handlers.MIGRATION = False

        sm = self.layer['portal'].getSiteManager()
        for component in self._utilities:
            sm.unregisterUtility(component)

        popGlobalRegistry(self.layer['portal'])
        super(TestViewsIntegration, self).tearDown()
Example #3
0
    def tearDown(self):
        # disable create_inital_version handler for og.documents
        # otherwise we have some savepoints problems with the sqlite db
        handlers.MIGRATION = False

        sm = self.layer['portal'].getSiteManager()
        for component in self._utilities:
            sm.unregisterUtility(component)

        popGlobalRegistry(self.layer['portal'])
        super(TestViewsIntegration, self).tearDown()
Example #4
0
    def test_preflight_request_without_cors_policy_doesnt_render_service(self):
        # "Unregister" the current CORS policy
        class NoCORSPolicy(object):
            def __new__(cls, context, request):
                return None

        pushGlobalRegistry(self.portal)
        provideAdapter(NoCORSPolicy, (Interface, IDefaultBrowserLayer), ICORSPolicy)

        headers = {"HTTP_ACCESS_CONTROL_REQUEST_METHOD": "GET", "HTTP_ACCEPT": "*/*"}
        service = self.traverse(method="OPTIONS", headers=headers)
        self.assertTrue(service() is None, "Should return None")

        popGlobalRegistry(self.portal)
Example #5
0
 def tearDown(self):
     popGlobalRegistry(getSite())
 def tearDown(self):
     self.time_freezer.stop()
     popGlobalRegistry(getSite())
Example #7
0
 def tearDown(self):
     super(Fixture, self).tearDown()
     with ploneSite() as portal:
         popGlobalRegistry(portal)
Example #8
0
 def __exit__(self, exc_type, exc_value, traceback):
     popGlobalRegistry(getSite())
Example #9
0
 def tearDown(self):
     portal = self.layer['portal']
     popGlobalRegistry(portal)
 def tearDown(self):
     popGlobalRegistry(self.portal)