Ejemplo n.º 1
0
 def test_it(self):
     from zope.interface import providedBy
     from pyramid_layout.interfaces import ILayout
     from pyramid_layout.layout import find_layout
     request = mock.Mock()
     lookup = request.registry.adapters.lookup
     Layout = lookup.return_value
     find_layout('context', request, 'test')
     Layout.assert_called_once_with('context', request)
     lookup.assert_called_once_with(
         (providedBy('context'),), ILayout, name='test')
Ejemplo n.º 2
0
 def test_it(self):
     from zope.interface import providedBy
     from pyramid_layout.interfaces import ILayout
     from pyramid_layout.layout import find_layout
     request = mock.Mock()
     lookup = request.registry.adapters.lookup
     Layout = lookup.return_value
     find_layout('context', request, 'test')
     Layout.assert_called_once_with('context', request)
     lookup.assert_called_once_with(
         (providedBy('context'),), ILayout, name='test')
Ejemplo n.º 3
0
 def test_layout_none(self):
     from pyramid_layout.interfaces import ILayout
     from pyramid_layout.layout import find_layout
     request = testing.DummyRequest()
     self.assertEqual(find_layout('context', request, 'test'), None)
Ejemplo n.º 4
0
 def test_layout_none(self):
     from pyramid_layout.interfaces import ILayout
     from pyramid_layout.layout import find_layout
     request = testing.DummyRequest()
     self.assertEqual(find_layout('context', request, 'test'), None)