예제 #1
0
파일: tests.py 프로젝트: dhavlik/Zope
 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)
예제 #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)
예제 #3
0
 def testDecoratorLoadsZCMLCallable(self):
     f = temporaryPlacelessSetUp(self.func, required_zcml=setupZCML)
     self.assertEqual(f(), True)
예제 #4
0
 def testDecoratedFuncLoadsZCMLIterable(self):
     f = temporaryPlacelessSetUp(self.func)
     self.assertEqual(f(required_zcml=(setupZCML,)), True)
예제 #5
0
 def testPlacelessFlagDisablesDecoration(self):
     f = temporaryPlacelessSetUp(
         self.func, placeless_available=False, required_zcml=setupZCML)
     self.assertRaises(TypeError, f)