Ejemplo n.º 1
0
    def setUp( self ):
        import transaction
        from zope.component.testing import setUp as componentSetUp
        from zope.component import provideUtility
        from zope.component import provideAdapter
        from zope.traversing.adapters import DefaultTraversable
        from zope.publisher.http import HTTPCharsets
        from Testing.ZopeTestCase import ZopeLite
        from Testing.makerequest import makerequest
        from Products.PageTemplates.interfaces \
            import IUnicodeEncodingConflictResolver
        from Products.PageTemplates.unicodeconflictresolver \
            import PreferredCharsetResolver


        componentSetUp()
        provideAdapter(DefaultTraversable, (None,))
        provideUtility(PreferredCharsetResolver,
                       IUnicodeEncodingConflictResolver)
        provideAdapter(HTTPCharsets)
        transaction.begin()
        app = ZopeLite.app()
        self.root = makerequest(app)
        # set the request charset to enable conversions to utf-8
        self.root.REQUEST['HTTP_ACCEPT_CHARSET'] = '*'
Ejemplo n.º 2
0
    def setUp( self ):
        import transaction
        from zope.component.testing import setUp as componentSetUp
        from zope.component import provideUtility
        from zope.component import provideAdapter
        from zope.traversing.adapters import DefaultTraversable
        from zope.publisher.http import HTTPCharsets
        from Testing.ZopeTestCase import ZopeLite
        from Testing.makerequest import makerequest
        from Products.PageTemplates.interfaces \
            import IUnicodeEncodingConflictResolver
        from Products.PageTemplates.unicodeconflictresolver \
            import PreferredCharsetResolver


        componentSetUp()
        provideAdapter(DefaultTraversable, (None,))
        provideUtility(PreferredCharsetResolver,
                       IUnicodeEncodingConflictResolver)
        provideAdapter(HTTPCharsets)
        transaction.begin()
        app = ZopeLite.app()
        self.root = makerequest(app)
        # set the request charset to enable conversions to utf-8
        self.root.REQUEST['HTTP_ACCEPT_CHARSET'] = '*'
def setUp(test):
    componentSetUp()
    endInteraction()
    provideAdapter(AttributeAnnotations)
    provideAdapter(AnnotationPrincipalPermissionManager, (IAnnotatable,),
                   IPrincipalPermissionManager)
    provideAdapter(AnnotationPrincipalRoleManager, (IAnnotatable,),
                   IPrincipalRoleManager)
    provideAdapter(AnnotationRolePermissionManager, (IAnnotatable,),
                   IRolePermissionManager)
    provideAdapter(AnnotationGrantInfo, (IAnnotatable,), IGrantInfo)