コード例 #1
0
ファイル: test_security.py プロジェクト: matkins/pyramid
 def test_backward_compat_delegates_to_mixin(self):
     from zope.deprecation import __show__
     try:
         __show__.off()
         request = _makeFakeRequest()
         from pyramid.security import authenticated_userid
         self.assertEqual(authenticated_userid(request),
                          'authenticated_userid')
     finally:
         __show__.on()
コード例 #2
0
ファイル: test_security.py プロジェクト: matkins/pyramid
 def test_backward_compat_delegates_to_mixin(self):
     request = _makeFakeRequest()
     from zope.deprecation import __show__
     try:
         __show__.off()
         from pyramid.security import effective_principals
         self.assertEqual(effective_principals(request),
                          'effective_principals')
     finally:
         __show__.on()
コード例 #3
0
ファイル: test_zcml.py プロジェクト: blaflamme/pyramid
 def tearDown(self):
     from zope.deprecation import __show__
     __show__.on()
     testing.tearDown()
     import sys
     import shutil
     if self.module is not None:
         del sys.modules[self.module.__name__]
     if self.tempdir is not None:
         sys.path.pop(0)
         shutil.rmtree(self.tempdir)
コード例 #4
0
ファイル: test_security.py プロジェクト: 7924102/pyramid
 def test_backward_compat_delegates_to_mixin(self):
     request = _makeFakeRequest()
     from zope.deprecation import __show__
     try:
         __show__.off()
         from pyramid.security import effective_principals
         self.assertEqual(
             effective_principals(request),
             'effective_principals'
             )
     finally:
         __show__.on()
コード例 #5
0
ファイル: test_security.py プロジェクト: 7924102/pyramid
 def test_backward_compat_delegates_to_mixin(self):
     from zope.deprecation import __show__
     try:
         __show__.off()
         request = _makeFakeRequest()
         from pyramid.security import unauthenticated_userid
         self.assertEqual(
             unauthenticated_userid(request),
             'unauthenticated_userid',
             )
     finally:
         __show__.on()
コード例 #6
0
ファイル: test_security.py プロジェクト: 7924102/pyramid
    def test_delegates_to_mixin(self):
        from zope.deprecation import __show__
        try:
            __show__.off()
            mixin = self._makeOne()
            from pyramid.security import has_permission
            self.called_has_permission = False

            def mocked_has_permission(*args, **kw):
                self.called_has_permission = True

            mixin.has_permission = mocked_has_permission
            has_permission('view', object(), mixin)
            self.assertTrue(self.called_has_permission)
        finally:
            __show__.on()
コード例 #7
0
ファイル: test_security.py プロジェクト: matkins/pyramid
    def test_delegates_to_mixin(self):
        from zope.deprecation import __show__
        try:
            __show__.off()
            mixin = self._makeOne()
            from pyramid.security import has_permission
            self.called_has_permission = False

            def mocked_has_permission(*args, **kw):
                self.called_has_permission = True

            mixin.has_permission = mocked_has_permission
            has_permission('view', object(), mixin)
            self.assertTrue(self.called_has_permission)
        finally:
            __show__.on()
コード例 #8
0
ファイル: test_settings.py プロジェクト: hathawsh/pyramid
 def tearDown(self):
     self.config.end()
     from zope.deprecation import __show__
     __show__.on()
コード例 #9
0
ファイル: test_session.py プロジェクト: dylfaust/pyramid
 def tearDown(self):
     super(TestUnencryptedCookieSession, self).tearDown()
     from zope.deprecation import __show__
     __show__.on()
コード例 #10
0
 def tearDown(self):
     from zope.deprecation import __show__
     __show__.on()
コード例 #11
0
ファイル: test_testing.py プロジェクト: SMFOSS/pyramid
 def tearDown(self):
     from pyramid.threadlocal import manager
     manager.clear()
     from zope.deprecation import __show__
     __show__.on()
コード例 #12
0
 def tearDown(self):
     from zope.deprecation import __show__
     __show__.on()
コード例 #13
0
ファイル: test_testing.py プロジェクト: jbohman/pyramid
 def tearDown(self):
     from pyramid.threadlocal import manager
     manager.clear()
     from zope.deprecation import __show__
     __show__.on()
コード例 #14
0
 def tearDown(self):
     super(TestUnencryptedCookieSession, self).tearDown()
     from zope.deprecation import __show__
     __show__.on()
コード例 #15
0
    debug = Attribute('The ``debug_templates`` setting for this application')
    auto_reload = Attribute('The ``reload_templates`` setting for this app')
    def __call__(self, info):
        """ Return an ITemplateRenderer based on IRendererInfo ``info`` """

class IChameleonTranslate(Interface):
    """ Internal interface representing a chameleon translate function """
    def __call__(msgid, domain=None, mapping=None, context=None,
                 target_language=None, default=None):
        """ Translate a mess of arguments to a Unicode object """

from zope.deprecation import __show__
__show__.off()
try:
    # For backwards compatibility, as long as ITemplateRenderer
    # exists, we will still implement that.
    from pyramid.interfaces import ITemplateRenderer
    class IChameleonTemplateRenderer(ITemplateRenderer):
        "Chameleon-specific template renderer"
except ImportError:
    from pyramid.interfaces import IRenderer
    class IChameleonTemplateRenderer(IRenderer):
        "Chameleon-specific template renderer"
        def implementation():
            """ Return the object that the underlying templating system
            uses to render the template; it is typically a callable that
            accepts arbitrary keyword arguments and returns a string or
            unicode object """
finally:
    __show__.on()
コード例 #16
0
ファイル: test_request.py プロジェクト: deshank/pyramid
 def tearDown(self):
     testing.tearDown()
     from zope.deprecation import __show__
     __show__.on()
コード例 #17
0
ファイル: test_settings.py プロジェクト: bennihepp/sandbox
 def tearDown(self):
     self.config.end()
     from zope.deprecation import __show__
     __show__.on()
コード例 #18
0
ファイル: test_request.py プロジェクト: bennihepp/sandbox
 def tearDown(self):
     testing.tearDown()
     from zope.deprecation import __show__
     __show__.on()
コード例 #19
0
                 domain=None,
                 mapping=None,
                 context=None,
                 target_language=None,
                 default=None):
        """ Translate a mess of arguments to a Unicode object """


from zope.deprecation import __show__
__show__.off()
try:
    # For backwards compatibility, as long as ITemplateRenderer
    # exists, we will still implement that.
    from pyramid.interfaces import ITemplateRenderer

    class IChameleonTemplateRenderer(ITemplateRenderer):
        "Chameleon-specific template renderer"
except ImportError:
    from pyramid.interfaces import IRenderer

    class IChameleonTemplateRenderer(IRenderer):
        "Chameleon-specific template renderer"

        def implementation():
            """ Return the object that the underlying templating system
            uses to render the template; it is typically a callable that
            accepts arbitrary keyword arguments and returns a string or
            unicode object """
finally:
    __show__.on()