Example #1
0
 def call_manage_main(self):
     """Call /folder/manage_main and return the HTML text."""
     def _call_manage_main(self):
         self.setRoles(['Manager'])
         # temporaryPlacelessSetUp insists in creating an interaction
         # which the WSGI publisher does not expect.
         endInteraction()
         response = self.publish(
             '/{0.folder_name}/manage_main'.format(Testing.ZopeTestCase),
             basic=basic_auth)
         return str(response)
     return temporaryPlacelessSetUp(
         _call_manage_main, required_zcml=setupZCML)(self)
Example #2
0
 def call_manage_main(self):
     """Call /folder/manage_main and return the HTML text."""
     def _call_manage_main(self):
         self.setRoles(['Manager'])
         # temporaryPlacelessSetUp insists in creating an interaction
         # which the WSGI publisher does not expect.
         endInteraction()
         response = self.publish(
             f'/{Testing.ZopeTestCase.folder_name}/manage_main',
             basic=basic_auth)
         return str(response)
     return temporaryPlacelessSetUp(
         _call_manage_main, required_zcml=setupZCML)(self)
 def testDecoratorLoadsZCMLCallable(self):
     f = temporaryPlacelessSetUp(self.func, required_zcml=setupZCML)
     self.assertEqual(f(), True)
 def testDecoratedFuncLoadsZCMLIterable(self):
     f = temporaryPlacelessSetUp(self.func)
     self.assertEqual(f(required_zcml=(setupZCML,)), True)
 def testPlacelessFlagDisablesDecoration(self):
     f = temporaryPlacelessSetUp(
         self.func, placeless_available=False, required_zcml=setupZCML)
     self.assertRaises(TypeError, f)